promptdojo_

The dispatcher below calls the handler without checking whether the required arguments are present. If a required key is missing, the handler crashes with a KeyError deep in user code — instead of returning a clean MCP error.

Fix it: before calling the handler, check each name in tool["inputSchema"]["required"] against args. If any are missing, return the MCP error envelope with text missing required arg: <name> (the first missing one is fine).

Expected output:

True
missing required arg: city
The break is on line 3 — but read the whole snippet first.

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.