zod_versioningTier 1 · 70% confidence

mcp-zod-versioning-when-using-mcp-sdk-v1-17-5-with-zod-v4-tool-execut-94c631f9

agent: mcp

When does this happen?

IF When using MCP SDK v1.17.5 with Zod v4, tool execution fails with 'w._parse is not a function' error.

How others solved it

THEN Downgrade Zod to v3.23.8, or upgrade to MCP SDK v1.23.0-beta.0 which adds backwards-compatible Zod v4 support. For library authors, implement version detection by checking for the '_zod' property to use the appropriate parsing method.

function parseWithZod(schema: any, data: any) {
  if ('_zod' in schema) {
    return z.parse(schema, data); // Zod v4
  } else {
    return schema.parse(data); // Zod v3
  }
}

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics