# What are the error codes in the Model Context Protocol?

The Model Context Protocol uses JSON-RPC's five standard error codes and, in the 2026-07-28 spec, defines three of its own. The standard ones are -32700 (parse error), -32600 (invalid request), -32601 (method not found), -32602 (invalid params), and -32603 (internal error). The three MCP codes are -32020, returned when HTTP headers don't match the request body or are missing, -32021, when a server requires a client capability the request didn't declare, and -32022, when the protocol version isn't supported.

The [JSON-RPC spec](https://www.jsonrpc.org/specification) reserves the range -32000 to -32099 for implementation-defined server errors, which is where the MCP codes sit.

These codes cover the request, not the tool. The [MCP spec](https://modelcontextprotocol.io/specification/2026-07-28/server/tools) returns an unknown tool name as -32602, and reports a tool that ran and failed as a normal result with `isError: true`, which the model can read and retry. [A tool call can fail in several other ways](/answers/tool-calling/what-are-the-ways-a-tool-call-can-fail) that never get a code.

A client may pass a protocol error to the model, but the spec says that is less likely to end in a successful recovery than an `isError: true` result, so a tool that ran and failed belongs in the result.

---

Published: 2026-11-23

Sources:
- Model Context Protocol schema, 2026-07-28 (schema.ts): https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/2026-07-28/schema.ts (fetched 2026-11-23)
- Model Context Protocol specification 2026-07-28: Tools, error handling: https://modelcontextprotocol.io/specification/2026-07-28/server/tools (fetched 2026-11-23)
- JSON-RPC 2.0 specification: error object: https://www.jsonrpc.org/specification (fetched 2026-11-23)

Source: https://tessary.ai/answers/mcp-tool-reliability/what-are-the-error-codes-in-the-model-context-protocol
More on MCP tool reliability: https://tessary.ai/answers/mcp-tool-reliability
From Tessary, agent reliability for AI agents in production: https://tessary.ai
