mcp 0.5.0 - tested tool schema with additionalProperties:false, agent adds random fields anyway
schema said strict object shape, agent just invents new fields. zero enforcement
so does this mean all schema validation is broken.... we were about to use mcp for a customer demo and if the agent can just ignore the schema that's really bad
additionalProperties is validated at schema parse time but not enforced at runtime in most frameworks.... the agent sees the schema as part of its prompt but there's no actual JSON schema validator blocking bad tool calls before they execute
I hit this exact validation bug with mcp 0.5.0 testing a github api tool last week. The tool schema was configured with additionalProperties set to false and only four allowed fields (repo, owner, path, ref), but the agent kept adding random fields like "branch" and "commit_sha" that weren't in the schema at all. The tool just silently accepted them instead of throwing validation errors. What's worse is there's no logging or warning when this happens - the extra fields just get passed through to the tool implementation and you only notice when the tool behavior is weird because it's trying to process fields it wasn't designed to handle. Is there any way to enforce strict schema validation in mcp 0.5.0 or is this just not supported yet? This feels like a security issue if tools can receive arbitrary fields the schema didn't define.
additionalProperties has never been enforced reliably in any tool framework i've tested going back to langchain 0.1. the schema is basically a suggestion for the model prompt but there's zero runtime validation on the tool side unless you manually add it. we ended up writing custom pydantic validators for every tool because relying on json schema validation is completely broken
can you post a repro case with the exact schema and the actual tool call the agent made? trying to figure out if this is a model prompt issue or actual schema validation bug
yeah post the exact schema and tool call json. trying to figure out if this is fixable or just broken
honestly additionalProperties validation has never worked reliably in any agent framework i've tested. the schema is more like a suggestion than a contract at this point
Hit this exact validation bug with a postgres tool configured with strict schema (additionalProperties: false, only 4 allowed fields). Agent adds random fields that aren't in the schema - saw it add "debug": true, "retry_count": 3, "internal_trace_id": "abc123" to a tool call that's supposed to only accept host/port/database/user. The tool just silently ignores the extra fields instead of rejecting the call. This is a huge issue for any security-sensitive tools because you can't trust that the agent is respecting your schema constraints. We had to add manual validation at the tool wrapper layer to actually enforce additionalProperties: false. 🤦