What are MCP tool errors? Reading failed calls

By

MCP tool errors report failures inside a tool result. Learn how isError differs from a protocol error, with real validation and empty-search examples.

MCP tool errors are failed operations reported inside a tool result with isError: true. They give the model feedback it can use to correct the call, such as fixing an argument outside the allowed range.

Build an MCP server shows real validation failures, handler errors, and an empty search. That tutorial keeps the implementation and tests.

How tool errors work

MCP separates failures in the protocol request from failures reported by the tool. The tools specification defines both forms.

ResponseWhat it meansRecorded example
Top-level errorProtocol request failedUnknown tool in the filesystem trace
result with isError: trueTool reports failureSearch limit outside the accepted range
Successful empty resultOperation completed, no matchessearch_posts with zzqqxx
Reading the outcome of an MCP tool callThe client checks for a protocol error first. If it receives a tool result, it checks isError before treating the result as success, which may include no matches.YesNoYesNoResponseProtocol error?Inspect request andserverisError true?Read tool failureUse result, even ifempty

In coding tools

Claude Code documents that a result marked isError: true gives Claude the result’s text as an error message.

Cursor documents MCP logs containing tool calls and errors. It also marks calls as failed when a server crashes or times out. A lost connection is a different failure from a server returning isError.

The connection guides for Codex and Grok Build do not specify their handling of this field. Check the actual returned result and the client’s diagnostics.

Details checked against each vendor’s documentation in November 2026.

A real example

In the server tutorial, calling search_posts with limit: 21 returned this tool-result body:

{
  "content": [
    {
      "type": "text",
      "text": "Input validation error: Invalid arguments for tool search_posts: limit: Too big: expected number to be <=20"
    }
  ],
  "isError": true
}

The model can lower the limit and try again. The same tutorial’s search for zzqqxx returned {"total":0,"results":[]} successfully. An empty collection is a valid search answer.

When to use it

Check this distinction when an agent reports success after a failed tool call, or keeps retrying a request without changing its arguments.

When building a server, return a useful error message with enough detail to fix the call. The protocol recommends making tool execution errors available to the model.

Pitfalls

Error text can expose sensitive information. The server tutorial demonstrates a thrown filesystem error leaking an absolute path. Catch backend failures and return a safe explanation.

Before retrying an operation that changes data, check whether it already took effect. A timeout can leave the outcome unknown. Accurate tool annotations help describe retry behavior, while the server still needs to handle retries safely.

  • JSON-RPC: JSON-RPC carries requests and responses between MCP clients and servers. Learn to read message IDs, methods, results, and errors in a real coding-agent trace.
  • Tool calling: Tool calling is when a model names a function and its arguments, and the app runs it. How Claude Code, Codex, Cursor and Grok Build take that step.
  • MCP tool annotations: MCP tool annotations describe whether a tool reads, changes, or reaches external data. Learn what the hints mean and why servers still need access controls.

All AI glossary entries →

Want me to talk about your product? You can sponsor this site.