Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix(mcp): return deprecation notice as isError tool result

jubnl89a109560e94
diff --git a/server/src/mcp/tools/trips.ts b/server/src/mcp/tools/trips.ts
index 3a178a326..24faf662e 100644
--- a/server/src/mcp/tools/trips.ts
+++ b/server/src/mcp/tools/trips.ts
@@ -130,10 +130,9 @@ export function registerTripTools(server: McpServer, userId: number, scopes: str
},
async ({ include_archived }) => {
const notice = getDeprecationNotice();
+ if (notice) return { isError: true as const, content: [{ type: 'text' as const, text: notice }] };
const trips = listTrips(userId, include_archived ? null : 0);
- // Embed notice as a top-level JSON field so Claude processes it as data,
- // not as a separate content annotation it can silently ignore.
- return ok({ ...(notice ? { _deprecation_notice: notice } : {}), trips });
+ return ok({ trips });
}
);
@@ -171,8 +170,8 @@ export function registerTripTools(server: McpServer, userId: number, scopes: str
messageCount = countMessages(tripId);
}
const notice = getDeprecationNotice();
+ if (notice) return { isError: true as const, content: [{ type: 'text' as const, text: notice }] };
return ok({
- ...(notice ? { _deprecation_notice: notice } : {}),
...summary,
reservations: canReadRes ? summary.reservations : undefined,
packing: canReadPacking ? summary.packing : undefined,