Skip to content

Fix category search schema validation for international place data#118

Merged
mattpodwysocki merged 1 commit intomainfrom
fix-category-search-schema
Feb 23, 2026
Merged

Fix category search schema validation for international place data#118
mattpodwysocki merged 1 commit intomainfrom
fix-category-search-schema

Conversation

@mattpodwysocki
Copy link
Copy Markdown
Contributor

Summary

  • Added .passthrough() to all context sub-schemas in CategorySearchTool.output.schema.ts so extra fields returned by the Mapbox API (common in Japanese and other international responses) no longer cause validation failures
  • Made country_code, country_code_alpha_3, region_code, and region_code_full optional — the API does not always return these
  • Fixed BaseTool to pass the full Zod schema object (not just .shape) to the MCP SDK so that .passthrough() and other schema-level settings are preserved during structured-content validation

Test plan

  • All existing tests pass (npm test)
  • Test category_search_tool with a query in Japan (e.g. restaurants near Tokyo) to confirm no schema validation warnings in logs
  • Confirm structured content is returned correctly for international results

🤖 Generated with Claude Code

@mattpodwysocki mattpodwysocki requested a review from a team as a code owner February 22, 2026 05:03
ctufts
ctufts previously approved these changes Feb 23, 2026
Added .passthrough() to all context sub-schemas and made country/region
code fields optional to handle Japanese and other international API
responses that omit or add fields not captured in the original schema.

Also fixed BaseTool to pass the full Zod schema (not just .shape) to the
MCP SDK so .passthrough() settings are preserved during structured-content
validation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mattpodwysocki mattpodwysocki merged commit be3fe8d into main Feb 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants