mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 08:30:05 +00:00
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:
@@ -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([]);
|
||||
});
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user