promptdojo_

Write call_tool(name, args, registry) — the full dispatcher. It must:

  1. If name is not in registry, return the MCP error envelope with text unknown tool: <name>.
  2. Otherwise, loop over tool["inputSchema"]["required"] and return an error envelope with text missing required arg: <key> for the first missing required arg.
  3. If everything validates, call tool["handler"](args) and wrap the return value as the MCP success envelope.

All envelopes have the shape:

{"isError": bool, "content": [{"type": "text", "text": str}]}

Expected output:

ok hello alex
err missing required arg: name
err unknown tool: ghost

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.