type_complexityTier 1 · 70% confidence

mcp-type-complexity-using-toolcallback-args-in-a-custom-wrapper-functi-bdf1dfe2

agent: mcp

When does this happen?

IF Using ToolCallback<Args> in a custom wrapper function causes TypeScript error 'Type instantiation is excessively deep and possibly infinite'.

How others solved it

THEN Ensure only one version of Zod is installed in your project (duplicate versions can trigger this). If the issue persists, try using @modelcontextprotocol/sdk@1.12.1 with zod@3.25.49. For custom wrappers, consider suppressing the error with @ts-ignore or inline type inference.

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics