0Pricing
MCP Academy · Lesson

Reading Errors in the Wire

Decode error codes and messages when calls fail.

Reading Errors in the Wire is a free MCP Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the MCP Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

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"}}

Codes Are Numbers

Each error carries a numeric code. Standard JSON-RPC codes are negative numbers, and a handful show up again and again on the wire.

Parse Error: -32700

Code -32700 means the server could not even parse your JSON. Usually a stray comma or broken quote broke the message itself.

{"error": {"code": -32700, "message": "Parse error"}}

Method Not Found: -32601

Code -32601 says the method name does not exist. Check for a typo or a method the server never advertised, like toolz/list.

{"error": {"code": -32601, "message": "Method not found"}}

Invalid Params: -32602

Code -32602 flags bad params: a missing argument or the wrong type. The method exists, but the inputs you sent do not fit.

{"error": {"code": -32602, "message": "Invalid params"}}

Internal Error: -32603

Code -32603 is the server's catch-all internal error. The request was fine, but something blew up while handling it.

{"error": {"code": -32603, "message": "Internal error"}}

Read the message Field

The code tells you the category; the message tells you the story. Always read it, since servers often add the exact field or reason that failed.

Optional data for Detail

Errors may also carry a data field with extra structured detail, like which parameter was rejected. Great for debugging when it is present.

{"error": {"code": -32602, "data": {"field": "a"}}}

Protocol Error vs Tool Failure

A JSON-RPC error means the protocol itself failed. A tool that runs but returns isError stays a normal result, so do not confuse the two.

A Debugging Reflex

Build the habit: read the code to classify, read the message to localize, then check data for the exact culprit. Most MCP bugs fall fast this way.

Quick Check

You sent a valid method but with a missing argument. Which error code fits?

Recap: Decoding Failures

You can now read failures fluently: an error object holds a code, a message, and sometimes data. Code classifies, message explains, and data pinpoints the cause.

Frequently asked questions

Is the “Reading Errors in the Wire” lesson free?

Yes — the full text of “Reading Errors in the Wire” is free to read here on the web, and the MCP Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the MCP Academy course, upgrade to CoddyKit PRO.

What will I learn in “Reading Errors in the Wire”?

Decode error codes and messages when calls fail. You practise MCP Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start MCP Academy?

No prior experience is required. MCP Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Reading Errors in the Wire” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this MCP Academy lesson?

Yes. Every MCP Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

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