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.