Modern LLM-based agents extend their capabilities far beyond text generation through tool use — the ability to invoke external tools such as APIs, code interpreters, databases, and web browsers. Function calling is the underlying mechanism: the LLM outputs structured JSON matching a predefined tool schema, which the system then executes, rather than producing free-form text. Structured output following a JSON or XML schema is parseable by code, in contrast to free-form natural language output. This tooling capability allows agents to perform actions like reading files, querying databases, and calling APIs in service of higher-level goals.
The ReAct pattern combines reasoning and acting by interleaving chain-of-thought reasoning with tool calls and observations. The agent thinks step-by-step, takes an action, observes the result, and continues reasoning. Related prompting strategies enhance this capability: chain-of-thought prompting asks the agent to show its reasoning step by step; tree-of-thought prompting explores multiple reasoning paths simultaneously and selects the best one; the plan-and-solve strategy separates planning from execution by first asking the LLM to produce a plan and then executing it step by step. Structured planning, where the agent outputs an explicit numbered plan in JSON before executing, enables plan validation and editing.
Effective tool use requires careful architecture. A tool registry catalogs all available tools with their descriptions, parameters, and schemas, while dynamic tool selection allows the agent to choose the most appropriate tool based on the current task. Tool-augmented generation enhances LLM output by allowing it to call tools mid-generation to retrieve facts or verify information. Zero-shot tool use enables an agent to correctly use a tool it has not been specifically trained on, based only on the tool's description, while few-shot prompting provides example interactions that demonstrate proper tool usage. To avoid overwhelming the context window, agents often employ an observation budget, limiting how much output from each tool call the agent processes.