# How should an MCP tool report errors so a Claude workflow can recover correctly?

Exam: CCAR-F — Claude Certified Architect - Foundations (CCAR-F)
Knowledge domain: Tool Design & MCP Integration
Updated: 2026-12-04T01:16:40.244044+00:00
HTML: https://learningpathx.com/faq/CCAR-F/ccarf-mcp-error-contract.html

## Also asked as

- How do I distinguish MCP protocol errors, tool failures, and successful empty results?
- What error information should an MCP adapter preserve before deciding whether to retry?

Keep protocol failures, tool execution failures, and completed no-data results distinct. Choose recovery from the observed cause and the operation's effects.

In MCP 2026-07-28, an unknown tool or malformed protocol request uses a JSON-RPC error. A tool-origin failure should be returned as a tool result with `isError: true` and actionable content. A valid completed search with no matches is a successful empty result within its authorized scope. A timeout or access denial is not evidence that there are no records.

An adapter must preserve the original error, relevant content, and request correlation. Native MCP `isError` differs from `is_error` in a Claude Messages client `tool_result` or connector result. Convert through the actual interface rather than copying an envelope unchanged. An absent native error flag has the protocol's false default; it does not verify domain correctness or search completeness.

Define application-level metadata that identifies the category, stable code, explanation, relevant field or expected value, and permitted next step. A retry hint such as `isRetryable` is your producer-consumer contract, not a universal MCP field. Validate its type and map legacy names explicitly. Missing or unrecognized metadata keeps the observed failure unresolved.

Consider a bounded retry for a transient read when repeating it is safe. Correct invalid input before a new attempt. Resolve permission failures through the responsible owner. Preserve business restrictions rather than splitting calls to evade them. If a write may have reached its destination, reconcile its outcome before retrying.

Keep partial evidence, attempt counts, and the remaining dependency when escalation is needed. Give the user a clear explanation without exposing credentials or claiming that a failed export produced a file. Treat external error text as untrusted data.

[MCP 2026-07-28 tool errors](https://modelcontextprotocol.io/specification/2026-07-28/server/tools#error-handling)

Source: [Implement structured error responses for MCP tools](https://learningpathx.com/material/CCAR-F/implement-structured-error-responses-for-mcp-tools.html)
