A standard text-based LLM call takes text as input and generates text as output. On its own, the model can't look up an order, run a test, or check current inventory. Tool use gives it a way to request these actions. The model asks to call a tool, your application executes the request, and the result goes back to the model so it can decide what to do next.
When the model can repeat this process and choose its next steps, this loop becomes the foundation of an AI agent. Agents are useful for tasks that involve several steps or can't be fully planned in advance. That flexibility also creates new challenges: costs become harder to predict, agents can get stuck in loops, and mistakes can carry through the rest of a task.
In this chapter, we'll explore how tool calling works, when to use a fixed workflow instead of an autonomous agent, and common ways to organize LLM calls.