Loading topic
run_tool function from the tool-calling chapter. A model never sees your code. It sees only a tool's name, description, and argument schema, and it chooses actions from those three things. Tool design is th2 min readmessages list that run_agent builds and with what a token is.2 min readrun_tool dispatches calls and how the loop stops. Guardrails sit in that dispatch path. They decide whether a call the model requested is allowed to run.2 min readrun_agent, run_tool, and the step limit. You also need basic Python and JSON.2 min read