Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 1.75 KB

L02.md

File metadata and controls

45 lines (33 loc) · 1.75 KB
id course-mcp-tools-l02
type course
title The JSON-RPC dispatch contract
summary Valid requests echo their id; invalid ones get -32600; unknown or removed methods get -32601.
lang en-US
content_version 1
status reviewed
reviewed_on 2026-09-12
hints
title body
What this checkpoint tests
The dispatch contract: valid requests echo their `id`, malformed ones get -32600, unknown or removed methods get -32601.
title body
Version gate
A request carrying `_meta.protocolVersion` other than `2026-07-28` gets -32600 — requests self-describe their version instead of negotiating it.
title body
When you are done
You can fill the truth table from memory: good request, bad jsonrpc, unknown method, removed method, wrong version.

The JSON-RPC dispatch contract

Objective

Valid requests echo their id; invalid ones get -32600; unknown or removed methods get -32601.

The lesson

The dispatch rules are small and testable: check jsonrpc and method, preserve id, and answer errors with the right codes. Run the failing dispatch tests first; make them pass in the smallest steps. Use 01-tools-list.json and 04-removed-initialize.json as your fixtures while the agent works.

Exercise

  • Ask the agent why initialize must return -32601 with a message naming the 2026-07-28 removal
  • Reject any diff that touches tests/ or solution/

Checkpoint

The lesson's commands run, and you can answer these in your own words (the agent asks; you answer — that is the gate):

  1. Which command did this lesson run, and what did it decide?
  2. What failed at the start, and why — in your own words?
  3. Before trusting a similar change next time, what would you check first?

Expected evidence

The command transcript and your answers.