Tools (AI Agents)
An LLM alone can only produce text. Tools are what let an agent actually do things — search the web, run code, query a database, send an email, fetch live data. Tools give the agent hands to act and senses to perceive, turning a language model into a system that can affect and observe the real world. Without tools, an agent is just a very eloquent thinker with no way to reach beyond its own words.
💡 In one line: Tools are external functions and APIs an agent calls to act on the world and gather real information.
What Are Tools?
Tools are external capabilities — functions, APIs, services — that the agent can invoke to act or to gather information. They extend the LLM well beyond text generation, and each one comes with a name, description, and parameter schema the model uses to call it.
Why Agents Need Tools
On their own, LLMs can't search the web, compute reliably, access private or live data, or take actions. Tools bridge that gap — giving the agent real observations to reason over and real actions to carry out.
Types of Tools
- Information / perceive — web search, retrieval (RAG), database queries, APIs (weather, stocks).
- Action / act — run code, send email, update records, file operations, bookings.
- Computation — calculator, code interpreter.
- Other agents — a sub-agent used as a tool.
- Built-in vs. custom vs. MCP — provider tools, your own functions, or standardised connectors.
How Agents Use Tools
Tool use is a loop: reason, pick a tool, call it, observe.
Tool Definitions
Each tool is described by a name, a description, and a parameter schema. The model chooses which tool to call — and fills in the arguments — based mainly on the descriptions, so writing them well matters. (See the Function Calling and Tool Calling subtopics for the mechanism.)
MCP (Model Context Protocol)
MCP is an open standard for connecting tools and data to agents in a consistent way — a common "plug" so you don't hand-wire every integration.
Tool Selection
Given a task, the agent picks the right tool from its toolbox. Clear descriptions help it choose well; a focused toolset beats a huge one, since too many tools make selection harder and more error-prone.
Benefits
- Real actions and live data, not just training knowledge.
- Reliable computation via code and calculators.
- Extensibility — add capabilities by adding tools.
Challenges & Safety
- Powerful tools (payments, deletion, email) need guardrails, permissions, and often human-in-the-loop approval.
- Error handling and tool reliability.
- Security — tool results can carry prompt-injection attacks; treat external data as untrusted.
- Cost and latency from many tool calls.
Best Practices
- Write clear tool descriptions; keep the toolset focused.
- Validate arguments and handle errors gracefully.
- Put guardrails and human approval on risky actions.
- Watch for injection in tool outputs.
Summary
- Tools give an agent hands to act and senses to perceive beyond text.
- They span information, action, computation, and even other agents.
- Agents use them in a loop: select → call → observe → continue.
- Descriptions drive tool selection; a focused toolset works best.
- Powerful tools need guardrails — and tool outputs can be a security risk.Â