Tool Calling
How a model asks your code to do things, and why your code decides.
function callingtool schemastool resultstool errors
Lessons
- 25.1How AI tool calling worksAn AI model can't press any buttons. It can only ask your code to press them. Here's how that conversation works, and where you keep it safe. 30 min Pick the tools
- 25.2Designing tool schemas the model can't misuseThe model only sees your tool's name, description and inputs. Design them well and it picks the right tool. Design them badly and it guesses. 30 min Pick the tools
- 25.3Tool errors, retries and loops that endTools fail all the time. What you tell the model next decides whether it fixes the problem, asks the guest, or loops forever. 30 min Retries, backoff and circuit breakers
On the job: try it on your own project
Pick one action from your own system that an AI model could call, such as look up an order. Ask Claude Code to draft its tool schema: name, description, parameters and error responses. Review it for vague names, missing limits and dangerous parameters. Write the final tool spec, including what the model should do on each error.
Can you do this now?
0/4. Anything you can't tick yet: reopen that lesson's practice ladder.