From 6dead09f70763284e53a160e5ee082c6d837a72c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-=C3=89lie=20Fauch=C3=A9?= Date: Tue, 23 Sep 2025 12:23:04 -0400 Subject: [PATCH 1/2] Zod to JSONSchema pipe strategies When converting Zod schema to JSONSchema, set the pipe strategy to the mode corresponding to the schema being generated, either input or output. This should help fix issues when the Zod schema has transforms. --- src/server/mcp.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/mcp.ts b/src/server/mcp.ts index ac4880c99..cef235270 100644 --- a/src/server/mcp.ts +++ b/src/server/mcp.ts @@ -120,6 +120,7 @@ export class McpServer { inputSchema: tool.inputSchema ? (zodToJsonSchema(tool.inputSchema, { strictUnions: true, + pipeStrategy: "input", }) as Tool["inputSchema"]) : EMPTY_OBJECT_JSON_SCHEMA, annotations: tool.annotations, @@ -129,7 +130,7 @@ export class McpServer { if (tool.outputSchema) { toolDefinition.outputSchema = zodToJsonSchema( tool.outputSchema, - { strictUnions: true } + { strictUnions: true, pipeStrategy: "output" } ) as Tool["outputSchema"]; } From 84dc1dfad25c059b880c75565f4b6dea5be756e1 Mon Sep 17 00:00:00 2001 From: Pierre-Elie Fauche Date: Wed, 8 Oct 2025 15:14:19 -0400 Subject: [PATCH 2/2] run prettier --- src/server/mcp.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/mcp.ts b/src/server/mcp.ts index 59cf9032f..765ba864f 100644 --- a/src/server/mcp.ts +++ b/src/server/mcp.ts @@ -105,7 +105,7 @@ export class McpServer { inputSchema: tool.inputSchema ? (zodToJsonSchema(tool.inputSchema, { strictUnions: true, - pipeStrategy: "input" + pipeStrategy: 'input' }) as Tool['inputSchema']) : EMPTY_OBJECT_JSON_SCHEMA, annotations: tool.annotations, @@ -115,7 +115,7 @@ export class McpServer { if (tool.outputSchema) { toolDefinition.outputSchema = zodToJsonSchema(tool.outputSchema, { strictUnions: true, - pipeStrategy: "output" + pipeStrategy: 'output' }) as Tool['outputSchema']; }