fix(mcp): name the tuple check for what it holds, describe a restored map point as [lat, lng]

MCP-SCHEMA-005 finds tuple keywords, it does not validate against the 2020-12 metaschema, so the name now says that. A restored map point lost its range and order to the tuple fix; the description keeps the order visible to a model that builds a page itself.
This commit is contained in:
Maurice
2026-10-29 13:49:41 +01:00
parent 6f4d7d9066
commit 81b3657528
2 changed files with 2 additions and 2 deletions
@@ -125,7 +125,7 @@ describe('MCP tool input schemas', () => {
expect(sizeOf('restore_book_layout')).toBeLessThan(2_000);
});
it('MCP-SCHEMA-005: every input schema is valid JSON Schema 2020-12 too, so no tool holds a tuple', () => {
it('MCP-SCHEMA-005: no input schema spells a tuple, the draft-07 form 2020-12 reads differently', () => {
const tuples = [...schemas].flatMap(([key, json]) => tuplesIn(json, '').map((at) => `${key} ${at}`));
expect(tuples).toEqual([]);
});
+1 -1
View File
@@ -378,7 +378,7 @@ const TRAVEL_TYPE = {
} as const;
const kindIn = (schema: z.ZodObject) => restoredFields(schema.omit(ELEMENT_BASE));
const travelIn = (schema: z.ZodObject) => restoredFields(schema.omit({ ...ELEMENT_BASE, ...TRAVEL_TYPE }));
const restoredPointIn = z.array(z.number()).length(2);
const restoredPointIn = z.array(z.number()).length(2).describe('[lat, lng]');
const restoredMapIn = travelIn(bookMapElementSchema).extend({
path: z.array(z.array(restoredPointIn).max(MAX_PATH_POINTS)).max(MAX_PATH_SEGMENTS).optional(),
roads: z.array(z.array(restoredPointIn).max(MAX_ROAD_POINTS).nullable()).max(MAX_ROAD_LEGS).optional(),