Spot the bug revealed by JSON-RPC tracing in this MCP exchange
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Click any words you think contain an error. Click again to unmark.
The response carries id 2 but the request was id 1. JSON-RPC correlates by echoing the request id, so the client can never match this reply.
Picture a busy coffee counter where everyone orders at once. The barista hands each order a numbered ticket and calls that number when the drink is ready. You hold ticket 1, but the barista shouts 'order 2!' and sets down your latte. You have no way to know it is yours, so you keep waiting while the coffee goes cold on the counter. JSON-RPC works the same way. The client tags each request with an id and keeps a list of tickets it is still waiting on. The server must reply with the exact same id so the client can match the answer to the right question. Here the request used id 1 and the reply came back as id 2, so the client never finds a match and the call stalls.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: identify the id mismatch, explain the pending-request map and correlation, give the two server bugs that cause it, and note why tracing is the tool that catches it.
| Aspect | Correct response | Buggy response shown |
|---|---|---|
| id value | Echoes request id (1) | New value (2) |
| Client lookup | Finds pending entry for id 1 | Finds nothing for id 2 |
| Outcome | Call resolves with the result | Original call hangs and times out |
| Data payload | Alice's row, correct | Alice's row, still correct |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Looking at the SQL or the result payload for the bug. The transport layer is broken first: the response id does not match the request id, so correlation fails.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.