Tools · troubleshooting record
Tool input fails schema validation
The server rejected a tool call because the arguments did not satisfy its input schema. This is often a tool-design problem: vague descriptions, unlabeled units, or overly permissive schemas cause a model to guess the wrong shape.
Symptoms
- The tool returns a validation error naming a property or type.
- The model repeatedly retries with the same wrong shape.
- Calls succeed in manual tests but fail when generated by an agent.
Confirmed causes
These causes have a documented basis. They may not be the cause of your specific failure.
Required fields are missing or the model uses a different key name
The server validates arguments against the declared JSON Schema; unknown or missing properties fail.
Type mismatches such as a string where a number is required
JSON Schema types are enforced by the server or the SDK's validation layer.
The tool description omits units, formats, or enum meanings
A model can only infer argument semantics from the tool name, description, and schema.
Possible causes
- The client strips or rewrites nested objects.
- The tool schema changed without updating the client cache.
- The model outputs JSON with trailing text.
What still needs verification
- The exact schema served by tools/list.
- The raw arguments in the failed request.
- Whether the server uses strict additionalProperties validation.
Affected environments
Fixes
Tighten the tool contract
- Add field descriptions, enums, formats, and examples to the schema.
- Name units explicitly, for example timeout_ms instead of timeout.
- Return a validation error that names the field and expected type.
Test with agent-generated arguments
- Capture the actual arguments from a failing client run.
- Add regression tests for those shapes.
- Avoid silently coercing invalid values; fix the contract or the caller.
Verify the fix
- A representative agent-generated call passes validation.
- Invalid input returns a clear, structured error.
- The tool description explains every non-obvious field.
Paste the configuration into the Config Doctor. It runs in your browser, never uploads the file, and can show structural issues and safe fixes.
Why we believe this
- modelcontextprotocol.io/specification/2026-07-28/server/toolsOfficial documentation · checked Oct 23, 2026 · documented
The specification defines tool input schemas and the tool call/result model.