mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 16:33:16 +00:00
fix(mcp): keep restore_book_page free of tuples so ChatGPT accepts the tool list
With the Journey addon on, ChatGPT refused every TREK tool: restore_book_page took a map's path and roads as [lat, lng] tuples, which the SDK writes as the draft-07 array form of items, and JSON Schema 2020-12 refuses that form. The restore now takes a map point as two numbers and parses each page as a spread before it is put back, so lat and lng stay checked and a point out of range is an invalid_op instead of a thrown parse. MCP-SCHEMA-005 holds every tool's input schema free of tuple keywords. Closes #2879
This commit is contained in:
@@ -75,6 +75,9 @@ export const MAX_MAP_POINT_LABEL = 120;
|
||||
/** A recorded track: segments, and points within one segment. */
|
||||
export const MAX_PATH_SEGMENTS = 40;
|
||||
export const MAX_PATH_POINTS = 1200;
|
||||
/** The roads a map draws: legs, and points along one leg. */
|
||||
export const MAX_ROAD_LEGS = 400;
|
||||
export const MAX_ROAD_POINTS = 200;
|
||||
|
||||
/**
|
||||
* Every shape the book can draw — and, because a picture frame *is* a shape with
|
||||
@@ -578,10 +581,10 @@ export const bookMapElementSchema = z.object({
|
||||
.array(
|
||||
z
|
||||
.array(z.tuple([z.number().min(-90).max(90), z.number().min(-180).max(180)]))
|
||||
.max(200)
|
||||
.max(MAX_ROAD_POINTS)
|
||||
.nullable(),
|
||||
)
|
||||
.max(400)
|
||||
.max(MAX_ROAD_LEGS)
|
||||
.default([]),
|
||||
/**
|
||||
* How much room to leave around what is drawn, as a share of its own extent.
|
||||
|
||||
Reference in New Issue
Block a user