claude-code - 💡(How to fix) Fix [BUG] Claude in Chrome MCP: tabId coerced from number to string in tool invocation layer, breaking navigate [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45141Fetched 2026-04-09 08:12:17
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
1
Author
Timeline (top)
labeled ×5commented ×1cross-referenced ×1

Error Message

Call: navigate with tabId: 785895690 (JSON number in the tool call):* MCP error -32602: Input validation error: Invalid arguments for tool navigate: [ { "code": "invalid_type", "expected": "number", "received": "string", "path": ["tabId"], "message": "Expected number, received string" } ]

For reference — tabs_context_mcp response (tabId is a number here): {"availableTabs":[{"tabId":785895690,"title":"New Tab","url":"chrome://newtab/"}],"tabGroupId":2063123329}

Code Example

*Call: `navigate` with `tabId: 785895690` (JSON number in the tool call):**
MCP error -32602: Input validation error: Invalid arguments for tool navigate: [
{
"code": "invalid_type",
"expected": "number",
"received": "string",
"path": ["tabId"],
"message": "Expected number, received string"
}
]

**For reference — `tabs_context_mcp` response (tabId is a number here):**
{"availableTabs":[{"tabId":785895690,"title":"New Tab","url":"chrome://newtab/"}],"tabGroupId":2063123329}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The tool invocation layer between the model and the Chrome MCP server coerces numeric parameters to strings before forwarding. The server's Zod schema then rejects tabId with a type validation error.

tabs_context_mcp returns tabId as a JSON number. The model passes it back to navigate as a JSON number. But the server receives it as a string.

What Should Happen?

tabId passed as a JSON number should arrive at the MCP server as a number.

Error Messages/Logs

*Call: `navigate` with `tabId: 785895690` (JSON number in the tool call):**
MCP error -32602: Input validation error: Invalid arguments for tool navigate: [
{
"code": "invalid_type",
"expected": "number",
"received": "string",
"path": ["tabId"],
"message": "Expected number, received string"
}
]

**For reference — `tabs_context_mcp` response (tabId is a number here):**
{"availableTabs":[{"tabId":785895690,"title":"New Tab","url":"chrome://newtab/"}],"tabGroupId":2063123329}

Steps to Reproduce

  1. Open Cowork with Claude in Chrome extension connected
  2. Call tabs_context_mcp with createIfEmpty: true — succeeds, returns tabId as a JSON number
  3. Call navigate passing that tabId as a number
  4. Fails with "expected": "number", "received": "string"

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.63 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

This is distinct from the connection-failure family of Chrome MCP issues (#21796, #23082, #27073, #40637). The extension connects fine and tabs_context_mcp succeeds. The bug is specifically type coercion in the invocation layer between model output and MCP server input.

Environment

  • Model: Claude Opus 4.6
  • Interface: Cowork
  • Chrome: 147.0.7727.56
  • Extension: Claude in Chrome 1.0.66
  • OS: Windows
  • Reproducible across sessions (confirmed April 7 and April 8, 2026)

extent analysis

TL;DR

The issue can likely be fixed by modifying the tool invocation layer to pass numeric parameters as numbers instead of coercing them to strings before forwarding to the Chrome MCP server.

Guidance

  • Verify that the tabId is indeed being coerced to a string by checking the request payload sent to the MCP server.
  • Investigate the tool invocation layer code to identify where the type coercion is occurring and modify it to preserve the numeric type of the tabId parameter.
  • Test the modified code by repeating the steps to reproduce the issue and checking if the tabId is received as a number by the MCP server.
  • Consider adding type checks or validation in the tool invocation layer to ensure that numeric parameters are not coerced to strings.

Example

No code snippet can be provided without knowing the exact implementation of the tool invocation layer, but the fix would involve changing the way numeric parameters are handled, for example, by using a library that preserves the numeric type or by manually checking the type of the parameter before forwarding it.

Notes

The issue is specific to the interaction between the Claude model and the Chrome MCP server, and the fix would depend on the implementation details of the tool invocation layer. The provided information suggests that the issue is a regression, and the previous working version may have handled numeric parameters differently.

Recommendation

Apply a workaround by modifying the tool invocation layer to correctly handle numeric parameters, as the root cause of the issue is identified and a targeted fix can be implemented.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING