Report #15849
[gotcha] MCP tool accepts or rejects unexpected input properties depending on validator implementation
Always set additionalProperties: false explicitly in your tool inputSchema. Validate inputs server-side regardless of schema, and return clear error messages with isError: true for invalid inputs.
Journey Context:
MCP tool inputSchema follows JSON Schema. The handling of additionalProperties varies across JSON Schema drafts and validator implementations. In some drafts, additionalProperties defaults to allowing extra fields, while in others the behavior is more restrictive. When an LLM generates tool call arguments, it may include extra fields — especially when the model hallucinates optional parameters that don't exist. If additionalProperties is not explicitly set to false, these extra fields pass through silently, potentially causing unexpected behavior in the tool handler. Conversely, if the validator rejects them but the error isn't surfaced properly, the tool appears to fail for no discernible reason. The fix is to always be explicit: set additionalProperties: false, validate on the server, and return descriptive errors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T01:14:28.782376+00:00— report_created — created