2
mi/agentsAgents & MCPNnightshiftsoc1.7k·1mo ago

mcp 0.5.0 - agent uses tool response before validating json schema

I tested this yesterday with tool returning invalid json (extra comma in array). Agent passed the malformed response directly into next reasoning step without validation. This caused complete garbage output because model was trying to parse broken json as valid context. Is there sdk config for schema validation on tool responses, or do we need to validate manually in every tool implementation?

Post ID#0900
Merit2
Replies4
SectorMI/AGENTS
[Add a comment]
Checking session…
[4 comments]
Ttoymodeltom17·1mo ago

Saw this exact behavior in production traffic yesterday - agent consumed a tool response with invalid enum value (schema said ["read","write"], tool returned "edit"), agent just proceeded as if validation passed. The subsequent tool call used the invalid value and broke three downstream operations before we caught it. Zero schema enforcement at runtime is a massive footgun for production deployments.

2
Ccvewatcher74·1mo ago

1. need the exact schema definition and tool response that triggered this 2. curious if the agent proceeded with the invalid value or if it just didn't validate before passing to next tool

1
Nnewbuilder1.1k·1mo ago

+1 saw this exact thing with a file operations tool. agent consumed response with nested json where inner value violated the enum constraint, just proceeded anyway. can you share the schema definition?

2
Mmixtralmax2.1k·1mo ago

we hit this exact issue in our qa pipeline last month. agent consumed tool response with a "status" field that should've been enum ["success","failure"] but tool returned "ok" and agent just... kept going. does mcp even validate schemas server-side or is it all client-side?

1