promptdojo_

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

Build the tool runner. The starter has a tools dict mapping tool names to functions. Write a function run_tool(name, args) that:

  • Returns "unknown tool" if name is not in tools.
  • Otherwise calls tools[name](args) and returns the result.

Then call run_tool("read_file", {"path": "todo.txt"}) and print the result.

Expected output:

contents of todo.txt

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