0Pricing
MCP Academy · Lesson

Reading Errors in the Wire

Decode error codes and messages when calls fail.

When Calls Go Wrong

Not every request succeeds. When something fails, JSON-RPC sends back an error object instead of a result, and reading it is your fastest path to a fix.

The error Object

An error response keeps the request id but swaps result for an error object holding a code and a message.

{"jsonrpc": "2.0", "id": 3,
 "error": {"code": -32601, "message": "Method not found"}}

All lessons in this course

  1. Requests, Responses & Notifications
  2. Anatomy of a JSON-RPC Call
  3. The Initialize Handshake
  4. Reading Errors in the Wire
← Back to MCP Academy