#187 — Your AI agents are only as good as the tools you give them
July 3, 2026·8 min read

Contents
Why it matters: Most founders building with LLMs bolt on API wrappers and call them "tools." That's leaving performance on the table — and burning tokens on noise. The lever that actually moves agent quality isn't a better model — it's better tools.
The big picture: Tools are a new kind of software contract — not between two deterministic systems, but between a deterministic system and a non-deterministic agent. A function like getWeather("NYC") always behaves the same way. An agent might call your tool, answer from memory, hallucinate, or ask a clarifying question first. That fundamental difference changes how you have to build.
The 3-Phase Process
Phase 1 — Prototype fast
- Use an AI coding assistant (Claude Code, Cursor, Gemini Code Assist) with library docs to scaffold tools quickly. Most doc sites publish a flat
llms.txtfile — feed it directly to your model of choice as context. - Wrap your tools in a local MCP server and connect it to your AI coding environment. Most major tools support MCP natively — check your tool's developer settings.
- You can also pass tools directly into API calls (Anthropic, OpenAI, Google) for programmatic testing — no MCP required for early experiments.
- Test the tools yourself first. Collect real user feedback early to build intuition around which workflows actually matter before writing a single eval.
Phase 2 — Build real evals (not toy ones)
Generating tasks: The quality of your evals is everything. Use your LLM to explore your tools and generate dozens of prompt/response pairs grounded in realistic data — real internal workflows, real documents, real message threads. Avoid synthetic or sandboxed environments that don't stress-test actual complexity. Strong tasks require multiple tool calls, potentially dozens.
Strong eval tasks look like:
- "Schedule a meeting with Jane next week to discuss the Acme Corp project. Attach the notes from our last planning meeting and reserve a conference room."
- "Customer ID 9182 was charged three times for one purchase. Find all relevant log entries and determine if any other customers were affected."
- "Customer Sarah Chen just submitted a cancellation request. Determine why she's leaving, what retention offer would be most compelling, and flag any risk factors before making the offer."
Weak eval tasks look like:
- "Schedule a meeting with jane@acme.corp next week."
- "Search payment logs for
customer_id=9182." - "Find the cancellation request for Customer ID 45892."
Running the eval: Run it programmatically via direct API calls. Use a simple while-loop — alternating LLM API calls and tool calls — one loop per task. In the system prompt, instruct your agent to output reasoning and feedback blocks before tool calls. This triggers chain-of-thought (CoT) behaviors that meaningfully increase effective intelligence. All major frontier APIs (Anthropic, OpenAI, Google) support this natively.
Verifiers: Pair every prompt with a verifiable expected response. Can be as simple as string matching or as advanced as LLM-as-judge. Avoid overly strict verifiers that penalize valid alternative phrasings. Optionally specify expected tool calls per task — but don't overfit to a single valid strategy when multiple paths could work.
Metrics to track beyond accuracy:
- Total runtime per task and per tool call
- Total number of tool calls (high counts reveal consolidation opportunities)
- Total token consumption
- Tool errors per parameter (high error rates on a specific input = description problem)
Read the transcripts — especially what the agent doesn't say. Agents don't always surface their confusion in stated reasoning. The raw tool call sequence often reveals more than the CoT. Watch for behavioral patterns: unnecessary calls, repeated lookups, subtle query biases. These are fixable with description changes alone.
Phase 3 — Let the model optimize its own tools
- Concatenate your eval transcripts and paste them into your AI coding tool of choice. Ask it to analyze results and refactor your tools.
- Frontier models (Claude, GPT-4o, Gemini) are especially good at making tool implementations and descriptions self-consistent across a large set of tools — particularly when a change to one tool creates downstream inconsistencies across others.
- Use held-out test sets (separate from your training evals) to prevent overfitting. Run this loop repeatedly — the performance gains compound and can exceed what expert human researchers achieve through manual iteration alone.
- Most of the principles below emerge naturally from this process once you run it seriously.
The 5 Principles
1. Build fewer, smarter tools
Agents have limited context. Computers have cheap memory. That asymmetry is your design constraint.
Don't wrap API endpoints — build tools that solve agent-sized jobs. Tools can consolidate multiple discrete operations or underlying API calls under the hood:
| Instead of… | Build… |
|---|---|
list_users + list_events + create_event | schedule_event — finds availability, schedules, notifies |
read_logs | search_logs — returns only relevant lines with context |
get_customer_by_id + list_transactions + list_notes | get_customer_context — compiles all recent relevant info at once |
Too many tools — or overlapping tools — distract agents from efficient strategies. Selective planning of what not to build is as important as what you do build.
2. Namespace everything
When agents have access to dozens of integrations and hundreds of tools, naming is how they navigate. Bad names = wrong tool calls.
- Namespace by service:
asana_search,jira_search - Namespace by resource type:
asana_projects_search,asana_users_search - Prefix vs. suffix matters — the effects are non-trivial and vary by model. Test both against your own evals.
Good naming also reduces the cognitive load on the agent — it offloads disambiguation from the model's reasoning back into the tool's structure.
3. Return signal, not data
Tools should return high-signal, contextually relevant information — not raw API dumps.
- Strip:
uuid,256px_image_url,mime_type - Keep:
name,image_url,file_type - Replace arbitrary alphanumeric IDs with semantically meaningful names wherever possible — this alone significantly reduces hallucinations in retrieval tasks.
When agents need both human-readable and technical identifiers (e.g., to chain tool calls like search_user(name='jane') → send_message(id=12345)), expose a response_format parameter:
enum ResponseFormat {
DETAILED = "detailed", // includes IDs, full metadata
CONCISE = "concise", // human-readable only
}
In a real-world Slack tool implementation: "detailed" = 206 tokens, "concise" = 72 tokens. Same downstream capability — one-third the cost.
Response format (XML vs. JSON vs. Markdown) also affects quality. LLMs predict next tokens and perform better with formats that match their training distribution. There's no universal answer — test it per model in your eval.
4. Token efficiency is a product decision
Context quality matters. Context quantity matters just as much.
- Implement pagination, range selection, filtering, and/or truncation with sensible defaults on any tool response that could balloon in size.
- Most frontier model APIs and agentic environments impose context limits on tool responses. Design for those ceilings — check the docs for your specific runtime (Claude Code, OpenAI Assistants, Gemini function calling, etc.).
- When truncating, steer the agent explicitly: instruct it to make many small, targeted queries rather than one broad sweep.
- When a tool call fails on input validation, write helpful, actionable error messages — not opaque error codes or stack traces. Tell the agent exactly what was wrong and give a concrete example of correct input.
5. Treat tool descriptions like landing page copy
Your tool descriptions load directly into the agent's context and steer every decision it makes. They're not documentation — they're prompts.
Write them the way you'd onboard a sharp new hire on day one:
- Make implicit context explicit: specialized query formats, niche terminology, relationships between underlying data models
- Use unambiguous parameter names:
user_idnotuser,start_datenotdate - Enforce expected inputs and outputs with strict schemas — avoid ambiguity at the edges
- Add concrete examples of correctly formatted inputs directly in the description
Small refinements here drive outsized results. Precise tweaks to tool descriptions — not model upgrades, not architectural overhauls — are often the specific lever that moves task completion rates and dramatically reduces error rates in production.
The meta-point
This process is meant to be iterative and ongoing. As your agent's scope expands and the underlying models evolve, your tools need to evolve with them. The founders who build a systematic, eval-driven loop — prototype → evaluate → optimize → repeat — are the ones whose agents compound in capability over time.
The bottom line: Your agent's ceiling is set before it makes its first API call. The tools you give it — their scope, names, descriptions, return formats, and error messages — are product decisions with directly measurable impact on accuracy, cost, and reliability. Treat them with the same rigor you'd treat your core product.
Act on it now
- Audit your existing tools: are they wrapping endpoints, or solving agent-sized jobs?
- Write 10 realistic eval tasks before touching another tool description — grounded in real workflows and real data
- Track more than accuracy: runtime, call count, token usage, error rates per tool
- Drop your eval transcripts into your AI coding tool and ask it to refactor your tool implementations and descriptions
- Use held-out test sets — separate from what you're optimizing against — to confirm you're not overfitting
Frequently asked questions
How many tools should my AI agent have?
Fewer than you think. The sweet spot for most production agents is 5–15 well-scoped tools rather than 50+ granular ones. Agents have limited context windows — every tool description you load competes for space with actual task information. Teams that consolidate overlapping tools (e.g., replacing list_users + list_events + create_event with a single schedule_event tool) consistently see fewer wrong tool calls, lower token spend, and faster task completion. Start with your 3–5 highest-impact workflows and scale from there.
Why is my AI agent calling the wrong tools even though the descriptions look fine?
The most common culprits are ambiguous naming and overlapping tool scope. When two tools share a similar purpose without clear namespace separation, agents guess — and often guess wrong. Fix it by namespacing by service and resource type (e.g., slack_messages_search vs. asana_tasks_search), and audit whether any two tools could plausibly answer the same user request. If they can, consolidate or differentiate. One real-world example: a web search tool was causing degraded results because the agent was appending 2025 to every query — a subtle bias only caught by reading raw call transcripts, fixed with a single description tweak.
What's the fastest way to improve AI agent accuracy without changing models?
Rewrite your tool descriptions. It sounds trivial — it isn't. Tool descriptions load directly into agent context and steer every decision the model makes. Treating them like prompts, not documentation (making implicit context explicit, adding concrete input examples, eliminating parameter ambiguity) has driven benchmark-level accuracy improvements without any model changes. The key step most teams skip: run a structured eval before and after each description change so you can measure the delta instead of guessing.
How do I build a proper eval for my AI agent tools?
Start with 10–20 realistic, multi-step tasks grounded in your actual workflows — not toy examples. A strong eval task looks like: "Customer 9182 was charged three times for one purchase — find all relevant logs and check if other customers were affected." A weak one looks like: "Search logs for customer_id=9182." Pair each task with a verifiable outcome (string match or LLM-as-judge), run them in a programmatic while-loop via direct API calls, and track accuracy, token usage, tool call count, and error rates per parameter — not just whether the agent got the right answer.
Should I use chain-of-thought (CoT) in my agent eval loops?
Yes — and you should make it explicit in your system prompt. Instructing agents to output reasoning and feedback blocks before each tool call (rather than just the call itself) triggers CoT behaviors that measurably increase task performance across all major frontier models. It also gives you a diagnostic layer: you can read the reasoning transcripts to understand why the agent made specific tool choices, not just what it did. This is often where you catch subtle misunderstandings of tool purpose or parameter format that never surface in accuracy scores alone.
How do I reduce AI agent token costs without degrading performance?
Add a response_format parameter to your tools. A real-world Slack tool implementation produced 206 tokens on "detailed" and just 72 tokens on "concise" — identical downstream capability at one-third the cost. Beyond that: implement pagination and filtering on any tool that could return large datasets, cap response sizes at your runtime's default limit (most major API environments impose one), and instruct agents explicitly to make many small targeted queries rather than one broad sweep. Token efficiency is a design decision, not an afterthought.
Why does my AI agent keep hallucinating IDs and technical identifiers?
Because UUIDs and alphanumeric identifiers are essentially random strings to an LLM — they carry no semantic signal. Replacing arbitrary UUIDs with human-readable names or 0-indexed IDs in tool responses significantly reduces hallucinations in retrieval tasks. Return name, file_type, and image_url — not uuid, mime_type, and 256px_image_url. When downstream tool calls genuinely require technical IDs (e.g., send_message(id=12345)), expose a response_format enum so agents can fetch the detailed version only when needed.
What's the difference between MCP tools and regular API wrappers?
The contract is different. A regular API wrapper is designed for deterministic, developer-controlled inputs. An MCP tool is designed for a non-deterministic agent that may call it with unexpected parameters, skip it entirely, or misunderstand its purpose based on a vague description. That means MCP tools need to be scoped around agent-sized jobs (not API endpoints), return contextually filtered responses (not raw data dumps), and have descriptions written like onboarding notes — not reference docs. The ergonomics that make a tool intuitive for an agent turn out to also make it intuitive for humans.
How do I use held-out test sets correctly when optimizing agent tools?
Separate your eval tasks into a training set (what you actively optimize against) and a held-out test set (what you only check at the end). Optimize your tool descriptions and implementations exclusively against the training set, then validate on held-out tasks before shipping. Without this split, you'll overfit — your agent will perform well on the tasks you tuned for and fail on anything slightly different. Teams running this loop iteratively — eval, optimize, re-eval on held-out — consistently extract performance gains beyond what manual expert tuning achieves.
Can I use an LLM to write and improve its own tools?
Yes — and it's one of the highest-leverage moves in the workflow. Concatenate your eval transcripts (tool calls, responses, reasoning blocks, errors) and pass them to your AI coding assistant with a prompt to analyze and refactor. LLMs are particularly good at ensuring self-consistency across large tool sets — catching cases where a change to one tool description creates a contradiction in another. The output often beats what human researchers produce through manual iteration, especially when paired with held-out test sets to validate the improvements aren't just overfitting.
What JSON response format works best for AI agent tools — XML, JSON, or Markdown?
There's no universal answer — it depends on your model and task type. LLMs are trained on next-token prediction and perform better with formats that match their training data distribution. Some models handle XML better for structured retrieval; others handle Markdown better for conversational outputs. The only correct approach is to test response formats as an explicit variable in your eval, measure the accuracy delta, and choose based on your own data. Don't assume what worked in one agentic context will transfer.
How do I write better AI agent tool descriptions?
Write them like you're onboarding a smart new hire who has never seen your codebase. That means: make implicit context explicit (specialized query formats, niche terminology, how resources relate to each other), use unambiguous parameter names (user_id not user, start_date not date), and include concrete examples of correctly formatted inputs directly in the description. The test: could someone — or something — follow this description with zero prior context and still call the tool correctly on the first try? If not, it needs more specificity.
What are MCP tool annotations and when should I use them?
Tool annotations are metadata flags in the MCP spec that disclose a tool's behavior to the client and agent — specifically whether a tool requires open-world access (e.g., reads external data) or makes destructive changes (e.g., deletes records, sends messages). They're not enforced at runtime but give agents and orchestration layers the signal they need to apply appropriate caution. Use them on any tool that writes, modifies, or deletes data — this is especially important in multi-agent setups where one agent's action can cascade into another's context.
How do I handle tool errors in AI agent pipelines without breaking the loop?
Write actionable, specific error messages — not stack traces or opaque error codes. When a tool call fails on input validation, the error message loads directly into the agent's context and steers its next action. A bad error message ("Error: 422 Unprocessable Entity") tells the agent nothing. A good one tells it exactly what went wrong and gives a concrete example of correct input format. Think of your error responses as micro-prompts: they should guide the agent toward the right retry strategy, not just log the failure.
What is interleaved thinking in AI agents and how does it help with tool use?
Interleaved thinking is a model capability where the agent outputs explicit reasoning between each tool call — not just at the start of a task. In practice, it means the agent can re-evaluate its strategy mid-task after seeing a tool response, rather than committing to a plan upfront. This dramatically improves performance on multi-step tasks where early tool calls reveal information that should change subsequent ones. For evals, it also gives you a detailed diagnostic view: you can read exactly why the agent chose each tool, what it expected to find, and how it interpreted the result — far more useful than a final answer alone.
How should I paginate tool responses for AI agents?
Implement pagination with sensible, conservative defaults — not the maximum your API supports. Agents don't benefit from receiving 500 results when 10 would answer the question; they just burn context on irrelevant data. Expose pagination parameters explicitly (e.g., page, limit, offset) and steer agents in your system prompt to start narrow and paginate only if needed. Pair truncated responses with a clear signal — like a has_more: true field — so the agent knows to paginate rather than assume the first page is exhaustive.
How do I benchmark my AI agent tool performance against industry standards?
The most widely cited benchmark for agentic tool use is SWE-bench Verified, which measures an agent's ability to resolve real GitHub issues using tools like file editing, terminal execution, and code search. For your own tools, build a domain-specific eval that mirrors your actual workflows — internal data, realistic prompts, multi-step tasks. Track accuracy, token consumption, runtime, and tool call count. Improvement on your own eval matters more than third-party benchmarks; the goal is compound improvement on your specific use case, not a leaderboard score.
Should I build separate tools for reading vs. writing operations in my AI agent?
Often yes — but the reason is safety, not just separation of concerns. Read tools are low-risk and can be called freely; write tools modify state and may be irreversible. Separating them lets you apply different permission levels, surface tool annotations (read-only vs. destructive), and give agents explicit guidance about when to confirm before acting. In practice, the pattern that works well is a read tool that retrieves and validates context first, followed by a write tool that acts on it — with an explicit confirmation step in between for any destructive operation.
How do multi-agent architectures affect tool design?
In multi-agent systems, tools need to be stateless, idempotent where possible, and clearly scoped — because multiple agents may call the same tool concurrently or in sequence with different assumptions about shared state. Tool descriptions need to be even more explicit about side effects, since a downstream agent receiving a tool response may have no context about what triggered the original call. Namespace your tools by agent role or domain if different agents have different permission levels, and design return formats that are self-explanatory without requiring prior conversation context.
Keep reading

#188 — Why your AI agent is broken and you don't know it yet
The capabilities that make agents useful also make them difficult to evaluate. The companies shipping AI agents fastest aren't guessing. They're running evals.

#189 — How to effectively context engineer for AI agents
How you feed information to your AI agents matters more than the prompts you write. This single insight is reshaping how the best AI-native teams build.

#190 — Agent skills are context management, not magic
Agent skills are not a new capability. Their value comes from routing and progressive disclosure, not from smarter prompts.