core practice · implementation task
Build a tool-calling loop
Give an LLM two tools (e.g. search and calculator). Run a loop: model emits a tool call, you execute it, feed the result back, repeat until done.
The mechanism
Tool calling turns the LLM into a planner: it emits a structured request to a named tool, your code executes it, and the result goes back into context. The model never runs code — it decides what to run.
Expected evidence
A task solved across multiple tool calls.
Try this drill in the practice workspace →
Hints when you need them
- Tool descriptions must be precise.
- Handle failed tool calls explicitly.
Watch for these mistakes
- Vague tool descriptions, so the model picks the wrong tool
- No error handling for failed tool calls
- Letting tools take dangerous actions without approval