createmcps.com

MCP-ERR-003

Resource-not-found uses -32602, not the retired -32002

“-32002 — resource not found (2025-11-25 and earlier; replaced by -32602). Implementations of this protocol version MUST NOT emit these codes.” — spec anchor

How to fix this

Use `-32602` for resource-not-found. `-32002` was retired in this revision and must not be emitted.

Example: failing and passing

The server reports a missing resource with -32002, a code this protocol version must not emit.
Violates MCP-ERR-003 · JSON
{
  "jsonrpc": "2.0",
  "id": 5,
  "error": {
    "code": -32002,
    "message": "Resource not found",
    "data": {
      "uri": "file:///nonexistent.txt"
    }
  }
}
The server reports the missing resource with -32602 (Invalid params), the code this revision uses for resource-not-found.
Complies with MCP-ERR-003 · JSON
{
  "jsonrpc": "2.0",
  "id": 5,
  "error": {
    "code": -32602,
    "message": "Resource not found",
    "data": {
      "uri": "file:///nonexistent.txt"
    }
  }
}

How the validator checks this

Probe P2.1, against a streamable-http server on the modern protocol. What it reports:

pass
No response used the retired -32002 code
fail
Emitted the retired -32002 code, replaced by -32602 in this revision (seen in probe …)

Quoted from the probe that runs this check, so it cannot drift from what the validator actually reports.

This rule is checked deterministically: a fail here is a certain violation, not an inference.

Checked in the same request as MCP-HDR-008, MCP-HDR-009, MCP-RES-003, MCP-RES-006, MCP-RES-007, MCP-ERR-004, MCP-ERR-005, MCP-ERR-008, MCP-CAC-001, MCP-CAC-002, MCP-CAC-003, MCP-CAC-004, MCP-CAC-005, MCP-SCH-001, MCP-SCH-002, MCP-SCH-003, MCP-SCH-004, MCP-SCH-005, MCP-SCH-006, MCP-SCH-007, MCP-SEC-004, MCP-SEC-005, MCP-SEC-006, MCP-DEP-005.

Check your own server against MCP-ERR-003

Probe P2.1 checks MCP-ERR-003 in the same request as 24 other rules, so one run shows your server's result for this rule next to the rest. Validate a server or read how the validator works.

Background on this topic: MCP error codes explained.

Other Error codes rules

  • MCP-ERR-001Unsupported version returns -32022 with data.supported[]
  • MCP-ERR-002Unknown method returns HTTP 404 and JSON-RPC -32601
  • MCP-ERR-004The retired -32042 code is never emitted
  • MCP-ERR-005No undefined code is emitted in the reserved -32020…-32099 range
  • MCP-ERR-006Missing required _meta field returns HTTP 400 + JSON-RPC -32602
  • MCP-ERR-007Missing client capability returns -32021 with data.requiredCapabilities
  • MCP-ERR-008New implementation-defined codes avoid the legacy -32000…-32019 range