promptdojo_

Wire it all together — a CLI agent in 12 steps — step 6 of 12

Cursor wrote a tool dispatcher that looks up a tool by name and calls it. The bug is on line 6 — when the tool isn't in the registry, the dispatcher crashes with a KeyError. Fix it so an unknown tool name returns the string "unknown tool" instead.

Expected output:

unknown tool
The break is on line 7 — but read the whole snippet first.

full-screen editor opens — close anytime to keep reading.