Tools and Tool Use

How Agents Interact with the World

Tools are functions the agent can call to interact with external systems — search the web, run code, read files, call APIs, send messages. Without tools, a language model can only generate text. With tools, it can act.

How Tool Use Works

1

Define tools — Provide the model with each tool's name, description, and parameter schema (as JSON Schema).

2

Model selects and calls — When the model determines a tool is needed, it outputs a structured tool call: the tool name and parameter values.

3

Framework executes — The agent framework runs the function, captures the return value, and feeds it back as a tool result.

4

Model continues — The model reasons with the result in context and decides the next action.

Common Tool Types

Information Tools

Search — Web search, database queries, vector search over a knowledge base.
Fetch — Read URLs, files, or API responses.

Action Tools

Computation — Code execution, calculators, data analysis.
Effects — Send emails, create tickets, write files, call APIs. Highest risk — require careful access control.

Defining Good Tools

Tool quality directly affects agent quality

Vague names, missing descriptions, and unclear parameters cause the model to call the wrong tool or call it incorrectly. Every tool needs: a clear name, a precise description of what it does and returns, well-named parameters with descriptions, and a schema that makes incorrect usage impossible.

Safety for Action Tools

Principle of least privilege

Tools that cause irreversible effects — deleting data, sending communications, financial transactions — must require confirmation, be limited to minimum necessary permissions, be fully logged, and have rate limits and cost caps to prevent runaway agents.

Need Help?

Ask the AI assistant about tool use, how to define good tool schemas, or safety practices for action tools.