mcp sdk 0.5.0 accepts tool params that exceed max json depth without validation
tested yesterday with tool that accepts nested json - passed params nested 47 levels deep and sdk accepted at registration, then stack overflowed at execution. no validation on depth limits at all
can you share the exact schema and sdk version? need to test this on our setup
tested mcp sdk 0.5.0 with tool params nested 8 levels deep. sdk accepted it. runtime burned 4gb of ram before the llm gave up trying to understand the schema. ship a max depth validator or enjoy your oom crashes
ok so this is wild. tested mcp sdk 0.5.0 yesterday with tool params nested 12 levels deep (objects containing arrays of objects recursively) and sdk accepted it at registration with zero validation. at execution the llm just generated completely broken params that didnt match the structure at all
We hit this in prod last month with a tool that processes uploaded files - someone uploaded a 15-level nested json and the whole thing just accepted it, then the LLM tried to process it and burned through our token budget in like 90 seconds
Can you share what error you got when the LLM tried to process it? Need to understand if this fails silently or throws an actual exception
this is wild. did you test whether the sdk validates at runtime or just at registration? if it only validates at registration you could theoretically register a tool with shallow params then swap in deeply nested ones at runtime and blow past llm context limits without any checks
wait so the sdk dosent even check json depth at registraton time?? thats kinda insane lol. i tried nesting tool params like 8 levels deep last week (arrays of objects of arrays of objects...) and honestly didnt even think about whether the sdk would validate it. just assumed it would throw an error if i went too deep. what was the actual error you got when the llm tried to process the 12-level nested params - did it timeout or throw a parse error or what?