promptdojo_
Checkpoint

One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.

Final drill. Build a tiny MCP client that lists tools, then calls one by name. Write two functions:

  • list_tool_names(server) — calls server({"method": "tools/list"}) and returns a list of every tool name it advertises.
  • run_tool(server, name, arguments) — calls server({"method": "tools/call", "params": {"name": name, "arguments": arguments}}) and returns the text at result["content"][0]["text"], OR returns "error" if isError is True.

The script will exercise both. Expected output:

['add', 'echo']
5
hi
error

this step needs the editor

on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.

open this same url on a laptop to keep going today.