Menu

AI

MCP Tool Call Failed: How to Fix It (Claude, Claude Code, Cursor, VS Code)

Fix MCP tool calls that fail while the server stays connected. Tell protocol errors from tool errors, read isError results and replay the call.

By: Irina ShvayaNovember 2, 2026

MCP Tool Call Failed: How to Fix It (Claude, Claude Code, Cursor, VS Code)

This fix is part of MCP troubleshooting, within The MCP Guide. Still stuck? Request a free MCP readiness review.

"Tool call failed" means the MCP server is connected, but one specific call did not succeed. Either the request itself was rejected (a protocol error, such as an unknown tool or bad arguments) or the tool ran and reported a problem (a tool execution error, such as an API failure or invalid date). The fastest fix is to copy the tool name and arguments, run the same call in the MCP Inspector, and read the exact error it returns.

Checked against: the MCP 2026-07-28 tools specification, Claude's connector troubleshooting page, the MCP Inspector docs, Cursor's MCP docs and the Claude Code MCP docs on 2 November 2026. eSEOspace did not reproduce failures in each client.

Key Takeaways

  • The spec defines two kinds of tool errors: protocol errors (JSON-RPC errors) and tool execution errors (results with isError: true).
  • An unknown tool returns a JSON-RPC error such as code -32602 with "Unknown tool: invalid_tool_name."
  • Tool execution errors carry "actionable feedback" so the model can "self-correct and retry with adjusted parameters."
  • Claude shows "Unexpected error while invoking tool" when the call reached the server and the server returned an error result.
  • Claude Code warns when tool output passes 10,000 tokens and limits output to 25,000 tokens by default.

What this error means

The 2026-07-28 tools specification splits failures in two.

Protocol errors cover "unknown tool," "malformed requests" and "server errors." They come back as standard JSON-RPC errors, for example:

{
  "jsonrpc": "2.0",
  "id": 3,
  "error": {
    "code": -32602,
    "message": "Unknown tool: invalid_tool_name"
  }
}

Tool execution errors cover "API failures," "input validation errors" and "business logic errors." They come back as a normal result with isError: true and a text message. The spec says clients "SHOULD provide tool execution errors to language models to enable self-correction."

So a failed call is not a broken connection. Claude's troubleshooting page says the same: "A failed tool call isn't a connection failure."

Quick fix

  1. Read the error text. It often says exactly what is wrong, such as a missing field or an expired record.
  2. Replay the call in the Inspector. The Inspector docs show a CLI form:
npx @modelcontextprotocol/inspector --cli https://api.example.com/mcp --transport http \
  --method tools/call --tool-name get_weather --tool-arg city=Boston --format json

For a local server, put its command after --cli instead of the URL.

  1. Compare the arguments with the tool's input schema from tools/list. Wrong types, wrong date formats and missing required fields are common.
  2. Check permissions. If the tool calls an outside API, your account may lack access to that record or action.
  3. Check the server logs at the time of the failure. Claude's troubleshooting page also asks whether the failure "affects every user of your connector or one account."
  4. Retry with corrected input, or tell the model what was wrong in your next message.

Fix by client / OS

Claude (claude.ai and Desktop connectors)

"Unexpected error while invoking tool," followed by the tool name, means "Claude's tool call reached your server, and your server returned an error result for it," per Claude's troubleshooting page. There is no ofid_ reference ID for tool failures. To report one, include the tool name, the time of the failure in UTC, and the connector URL.

Claude Code

The Claude Code MCP docs say Claude Code shows a warning when tool output exceeds 10,000 tokens and limits it to 25,000 tokens by default. Raise the limit with MAX_MCP_OUTPUT_TOKENS=50000. Long-running tools can hit the tool timeout; set MCP_TOOL_TIMEOUT or a per-server timeout.

Cursor

Cursor's MCP docs say failed tool calls are marked as failed in chat, and you can retry or check the logs. Cursor asks for approval by default, and you can expand a call to see its arguments, which helps spot bad input.

VS Code

Use MCP: List Servers > Show Output to read the server's side. The VS Code MCP page notes that a running server does not guarantee its tools are available to the current session.

Where to find the logs

WhereWhat to look for
Server logsThe handler's exception and the arguments it received
Claude Desktopmcp-server-SERVERNAME.log for local servers
CursorMCP Logs in the Output panel
Claude Code/mcp and the tool result in the transcript
InspectorThe raw JSON-RPC request and response

Map any JSON-RPC code you see with the MCP error code lookup.

If it still fails

If a vendor tool keeps failing in ways that hurt your team's work, an MCP readiness audit can decide whether to replace it or wrap it.

More in the MCP Guide

Free tools: MCP Error Code Lookup · MCP Config Generator

Latest research: State of MCP: October 2026

Frequently asked questions

Why does Claude retry a failed tool on its own?

Tool execution errors are sent back to the model so it can adjust and try again. That is by design in the spec. If the retries keep failing, the input or permissions need fixing.

Is "tool call failed" a server bug?

Sometimes. It can also be bad input from the model, missing permissions, or an outside API being down. Replay the call in the Inspector to tell which.

How do I stop the model from calling a risky tool?

Set that tool to need approval or block it in your client. Use the MCP tool permission planner to decide which tools stay read-only.

Can large results cause a tool call to fail?

Yes. Clients set output limits. Claude Code caps output at 25,000 tokens by default, and saves text results longer than 50,000 characters to a file unless the server raises that tool's limit.

You Might Also like to Read

Get a FREE Website Audit

Enter your website and get a 20–30 page SEO, GEO, AEO & CRO audit within 24 hours. Completely free.

Don't have a site yet? Get in touch →

Ready to speak with a marketing expert?
Give us a call! (916) 866-7893

Websites Launched
1407
Websites Launched
Marketing Experts
29
Marketing Experts
Hours of Dedicated Work
204533
Hours of Dedicated Work
Irina S.Benjamin G.Jeanette M.David G.