From 4c540e252d1bda3f81774906e3e9e5f2ae521613 Mon Sep 17 00:00:00 2001 From: Matthew Podwysocki Date: Mon, 5 Jan 2026 10:03:14 -0500 Subject: [PATCH] Add metadata field to SearchAndGeocodeTool schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Mapbox Search Box API can return metadata (including primary_photo and Japanese reading information) for various feature types in forward geocoding results. Currently, SearchAndGeocodeTool.output.schema.ts doesn't include a metadata field, which could lead to validation errors when the API returns this data. This fix adds the metadata field with the same structure used in CategorySearchTool (fixed in PR #77): - primary_photo: Accepts both string and array of strings - reading: Optional Japanese reading information (ja_kana, ja_latin) This prevents validation failures when the API returns metadata fields. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .../SearchAndGeocodeTool.output.schema.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/tools/search-and-geocode-tool/SearchAndGeocodeTool.output.schema.ts b/src/tools/search-and-geocode-tool/SearchAndGeocodeTool.output.schema.ts index ae9d434..7ef8196 100644 --- a/src/tools/search-and-geocode-tool/SearchAndGeocodeTool.output.schema.ts +++ b/src/tools/search-and-geocode-tool/SearchAndGeocodeTool.output.schema.ts @@ -100,6 +100,20 @@ const SearchBoxFeaturePropertiesSchema = z brand_id: z.union([z.string(), z.array(z.string())]).optional(), external_ids: z.record(z.string()).optional(), + // Metadata schema for additional feature information + metadata: z + .object({ + // API sometimes returns string, sometimes array - accept both + primary_photo: z.union([z.string(), z.array(z.string())]).optional(), + reading: z + .object({ + ja_kana: z.string().optional(), + ja_latin: z.string().optional() + }) + .optional() + }) + .optional(), + // Additional metadata maki: z.string().optional(), operational_status: z.string().optional(),