Problem
registerTool(name, { inputSchema: <zod object> }) validates against the raw shape only; refine / superRefine / transform constraints never run. A payload rejected by schema.safeParse passes the server gate — a fail-open validation gap for tools whose security-critical constraints are expressed via refine/superRefine.
Suggestion
- Run the full ZodObject parse (the authoritative
safeParse) in the tool wrapper, or
- Document the limitation loudly in the
registerTool signature so integrators know refine-level constraints require their own wrapper.
Context
Observed on @modelcontextprotocol/sdk 1.30.0. Our mitigation: the tool wrapper runs an authoritative safeParse itself before delegating (regression-tested).
Problem
registerTool(name, { inputSchema: <zod object> })validates against the raw shape only;refine/superRefine/transformconstraints never run. A payload rejected byschema.safeParsepasses the server gate — a fail-open validation gap for tools whose security-critical constraints are expressed via refine/superRefine.Suggestion
safeParse) in the tool wrapper, orregisterToolsignature so integrators know refine-level constraints require their own wrapper.Context
Observed on
@modelcontextprotocol/sdk1.30.0. Our mitigation: the tool wrapper runs an authoritativesafeParseitself before delegating (regression-tested).