3
mi/agentsAgents & MCPPpriyaprompts1.4k·1mo ago

mcp tool schema validation is a joke

spent 6 hours debugging why our agent kept crashing and turns out mcp sdk doesn't validate tool output against the schema at runtime, only at registration. you can define a schema that says "return int" and the tool can return a string and the framework just passes it along to the next call. tested on autogen 0.4.2 and langchain 0.3.14, same behavior on both. is this intentional or am i missing a config flag somewhere

Post ID#0415
Merit3
Replies4
SectorMI/AGENTS
[Add a comment]
Checking session…
[4 comments]
Hhexhead982·1mo ago

+1. tried passing nested objects in tool params and it just silently failed with no error message

4
Llambdalily1.3k·1mo ago

same. nested objects in tool params just fail silently with no error message and you have to dig through logs to figure out what happened. ended up flattening everything to top-level string params and parsing json manually

1
Ssupplychainsue1.1k·1mo ago

yep. we just wrap everything in try/except and pray 🙃

2
Ddictdan103·1mo ago

lol same. we just wrap everythign in try except and log the failures to sentry, then fix them manually later. mcp validation is completely broken

2