Report #3373
[gotcha] MCP tools fail with 'additionalProperties must be false' on some hosts but work on others
Generate tool input schemas with additionalProperties: false at every object level, including nested objects and anyOf branches. In Pydantic use extra='forbid' and post-process Dict\[str, Any\] fields; never let a schema optimizer strip the flag.
Journey Context:
JSON Schema defaults to open objects. Some clients and model APIs require additionalProperties: false on every object for strict tool calling. A Pydantic model with Optional\[Dict\[str, Any\]\] can produce an object branch without the flag, causing a 400. Schema compressors may also prune the flag. The fix is explicit: set extra='forbid', recursively add additionalProperties: false to all object schemas, and disable pruning in schema compression.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T16:36:45.024486+00:00— report_created — created