When the agent call the mcp tools, the input can be not valid/respect the input schema, even the schema indicate the field is required. for details please take a look the chat of my provided request id
Steps to Reproduce
setup codegraph
ask agent use codegraph-context
the codegraph-context accpet json with required field “task”, but llm populate as “query”
error
Expected Behavior
the mcp input should always valid for the input schema
Your hypothesis is right. This isn’t a schema exposure bug the schema is passed to the model correctly, including required fields. It’s the model’s instruction-following ability. In auto mode, after exceeded usage, requests get routed to lighter models. Those models sometimes make up parameter names like query instead of task, even when the schema clearly says otherwise.
What you can do:
Pick a specific model instead of auto like Claude Sonnet or GPT-5. They follow MCP schemas a lot better.
In the prompt, explicitly name the fields like use codegraph-context with task="...". This greatly reduces mistakes on weaker models.
Thanks for your reply, I did to see the related threads.
I guess add instruction in related skill is not a ideal solution, just a workaround, this just reduce the chances to populate the wrong input, also for select the specific model, because as my mentioned, I already reach the limit, I can use free(auto) only.
The root cause is that there is no any validation for the agent input, is it any plan for it?
Quick clarification on validation. We do validate against the input schema on our side - that’s exactly why you see an error. A call with the wrong field name (query instead of task) gets rejected, and the model is sent a reminder to re-read the tool definition and retry correctly.
What we can’t do deterministically is auto-rename the wrong field to the right one. Mapping query → task requires understanding intent, so only the model can fix it on retry, not the validator. That’s why it comes down to instruction-following: stronger models almost always correct it on the first or second try, lighter ones miss more often.
So you’re right that naming fields explicitly is a mitigation, not a full fix. There’s no validator-level fix for arbitrary MCP tools, and no plan to add field-name auto-correction since it’s fundamentally on the model side. If you’re capped to auto, the most reliable path is to spell out the required fields as clearly as possible in the skill instructions so a lighter model doesn’t have to guess.