Cursro agent does not respect the input schema of MCP tools

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

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

  1. setup codegraph
  2. ask agent use codegraph-context
  3. the codegraph-context accpet json with required field “task”, but llm populate as “query”
  4. error

Expected Behavior

the mcp input should always valid for the input schema

Operating System

Windows 10/11

Version Information

Version: 3.5.17 (user setup)
VSCode Version: 1.105.1
Commit: d5b2fc092e16007956c9e5047f76097b9e626ca0
Date: 2026-05-20T02:43:31.559Z
Layout: editor
Build Type: Stable
Release Track: Nightly
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.22631

For AI issues: which model did you use?

auto

For AI issues: add Request ID with privacy disabled

Request ID: a917b0d3-ef6f-479d-91f3-fa8332f69d1c

Additional Information

i am team plan and already exceed the usage limit, seem cause by the capability of the free model

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report and the request ID.

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.

Related threads:

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 querytask 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.