MCP tool wrapper injects parameters the action model forbids (pageId/timeout) — tools with mismatched inputSchema are unusable
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- ai-infra-agents, backend
Research direction
Start by tracing the MCP tool wrapper and the action model generation from the server's inputSchema; the issue does not name source files or tests. Compare the schema advertised to the model with the fields passed into validation, focusing on pageId and timeout. Done means tools that do not declare those fields pass validation and still call the MCP server.
Written by the indexing model from the issue text.
Description
Bug summary
The SDK tool-call path for MCP tools fails validation with extra_forbidden errors for parameters the SDK itself injects, making certain MCP tools completely unusable through the session tool interface — the call never reaches the MCP server.
This is not model hallucination (unlike #5610 / #5608): the extra parameters (pageId, timeout) are added by the SDK's MCP tool wrapper, while the pydantic action model generated from the MCP server's real inputSchema uses extra="forbid". The schema advertised to the model and the validating model disagree.
Environment
- OpenHands SDK: 1.60.1 (agent-canvas local stack)
- MCP servers tested:
[email protected],@browsermcp/[email protected]
Reproduction
Configure either MCP server and invoke a tool whose real inputSchema lacks the wrapper-injected parameters:
chrome-devtools_new_page→ SDK injectspageIdbrowser_mcp_browser→ caller passestimeout(also advertised)
Error validating tool 'chrome-devtools_new_page': 1 validation error for MCPChromeDevtoolsNewPageAction
pageId
Extra inputs are not permitted [type=extra_forbidden, input_value=1, input_type=int]
For further information visit https://errors.pydantic.dev/2.14/u/extra_forbidden
Analysis
The wrapper appears to add routing parameters (pageId) and lifecycle parameters (timeout) uniformly across an MCP server's tools, but the action model (MCPChromeDevtoolsNewPageAction, MCPBrowserMcpBrowserAction, …) is built from the server's declared inputSchema. For tools that legitimately don't accept those parameters (new_page, list_pages, the single aggregate browser tool), every call fails client-side validation.
Workaround
Calling the same MCP servers through the agent-server's raw MCP test endpoint (POST /api/mcp/test, which bypasses the wrapper) works correctly — the MCP servers themselves are fine, confirming the bug is in the SDK's tool-schema/action-model generation.
Expected behavior
The tool schema presented to the model and the validating action model should be generated from the same source (the MCP server's inputSchema). Wrapper-level routing/lifecycle parameters should be stripped before action-model validation (or handled out-of-band), so tools that don't declare them remain callable.
Related
- #5488 (PR: drop unknown tool-call arguments) — would mask this class of error rather than fix the schema-mismatch root cause
- #5610, #5608 — model-hallucinated extra params; same symptom (
extra_forbidden), different mechanism
This issue was drafted by an AI agent (OpenHands) on behalf of the user, who reviewed and approved the content before submission.
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 797
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 354
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenHands/software-agent-sdk
-
[Bug]: `list_directory` reports a complete listing as truncated when a directory has exactly 500 entriesPossibly taken @balabommablock-cpu claimed this 29 days ago. Openbug priority:low ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
OpenHands/software-agent-sdk#6133 ·
Maintainers usually reply within 1 day
-
[Bug]: Command hook that exits 1 is treated as blocking when its stdout is a JSON `deny` or `continue: false`Possibly taken A pull request linked to this issue is open or already merged. Openbug priority:low ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenHands/software-agent-sdk#6116 · 3 comments ·
Maintainers usually reply within 1 day
-
[Bug]: TypeScript GET-with-body requests remain pending after a truncated responsePossibly taken @BlueRaddish claimed this 34 days ago. Openbug priority:low ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
OpenHands/software-agent-sdk#6059 ·
Maintainers usually reply within 1 day
-
[Bug]: Document whether `prompt_tokens` includes `cache_read_tokens` in accumulated token usagePossibly taken @Jaxon1216 claimed this 36 days ago. Openpriority:low ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OpenHands/software-agent-sdk#5975 ·
Maintainers usually reply within 1 day
-
priority:low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
OpenHands/software-agent-sdk#5708 · 1 comment ·
Maintainers usually reply within 1 day
All issues in OpenHands/software-agent-sdk
Similar issues
-
[Bug]: reme CLI crashes when the running server used a relative config pathPossibly taken @nurlanmnn claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
agentscope-ai/ReMe#770 ·
Maintainers usually reply within 1 day
-
Pi: paused model calls are reported as "not signed in" when the model's provider comes from an extensionPossibly taken @balcsida claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
microsoft/TokenEconomizer#288 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 67/100
sickn33/agentic-awesome-skills#2437 ·
Maintainers usually reply within 1 day
-
site-bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ethereum/consensus-specs#5846 ·
Maintainers usually reply within 1 day