Merge pull request #150 from disintegrator/zod-to-json-schema-strict-unions

fix: drop unresolved union members in zod schemas
This commit is contained in:
Justin Spahr-Summers 2025-02-19 14:26:13 +00:00 • committed by GitHub
commit 506ae06b03
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -108,7 +108,9 @@ export class McpServer {
name,
description: tool.description,
inputSchema: tool.inputSchema
? (zodToJsonSchema(tool.inputSchema) as Tool["inputSchema"])
? (zodToJsonSchema(tool.inputSchema, {
strictUnions: true,
}) as Tool["inputSchema"])
: EMPTY_OBJECT_JSON_SCHEMA,
};
},