What Is Tool Use
A tool is a function an AI agent can call to connect with the outside world and actually act. An LLM alone cannot read or write files, call external APIs, or execute code. Tools are the bridge that connects that gap to a real execution environment.
Types of Tools
| Tool category | Examples |
|---|---|
| Information retrieval | Web search, database queries |
| Computer operations | Code execution, file read/write |
| Browsing | Viewing and scraping web pages |
| External services | Sending email, calendar operations, GitHub operations |
MCP is increasingly used as a standardized way to connect multiple tools to external systems.
Elements of a Good Tool Definition
Handing a tool to an AI requires more than a function signature — the AI needs enough information to judge when and how to use it.
| Element | Description |
|---|---|
| Name | A concise identifier for what the tool does |
| Description | What it does, and when it should be used |
| Input parameters | Types, required fields, and constraints |
| Output format | The shape of the result the AI receives |
| Usage conditions | When it’s appropriate to use, and when it isn’t |
Tool name: search_docs
Description: Full-text search over internal documents. Use when the user asks to "look up" or "find information about" something.
Input: query (search keywords, required), max_results (result count, optional, default 5)
Output: A list of title, URL, and excerpt
Usage conditions: Do not include documents containing confidential information in the search scopeA vague description makes it easy for the AI to misjudge which tool to use and when. When multiple tools have overlapping roles, drawing a clear boundary between them matters.
Principles to Follow
1. Grant Least Privilege
Give a tool only the permissions the task actually requires. A file-search tool doesn’t need write access. The “least privilege” principle from harness engineering applies directly to tool design as well.
2. Return Structured Errors
Tools can fail — external API outages, rate limits, expired authentication. Returning structured error information helps the AI judge whether to retry, try a different approach, or check with a human.
3. Handle Destructive Operations Carefully
Tools that perform irreversible operations — deleting files, sending email, writing to production — should include confirmation steps or approval flows.
Pages in This Section
| Page | Content |
|---|---|
| Tool Selection Failures and Fixes | Why an AI picks the wrong tool, and how to fix it |
| Execution Permissions and Approval | Least-privilege design and where approval belongs |
| Tool Error Handling | Error message design and retry policy |
Summary
- Tools are how an AI agent connects with the outside world and actually acts
- Clear names, descriptions, input parameters, and usage conditions help the AI choose the right tool
- The principle of least privilege and structured error handling are key safety measures in tool design
- MCP is an increasingly common standardized way to connect tools