All notes
In this note (5 sections)
Tooling May 25, 2026Updated Jul 6, 2026 8 min

Your agents aren't broken. Your tools are.

Last updated on Jul 6, 2026

An AI tool is not a function. It is a strict contract.

Introduction

I spent a day last quarter debugging an agent that kept "hallucinating" order lookups. The tool returned null on not-found. Null tells the model nothing, so it invented a reason. We changed the error to order_id_not_found and the agent started recovering on the next turn. No model swap. No prompt rewrite.

An AI tool is not a function. It is a contract the model has to trust. The long-form breakdown is in tool descriptions are prompts. This note is the one-glance version.

Question 1: Is it atomic?

One tool equals one verb. If a tool does two things, the model has to reason about which half it wants and it gets that reasoning wrong. Split it immediately.

Bad: get_order_and_update_status. Good: get_order_status and update_order_status as separate tools with separate descriptions.

Question 2: What happens on failure?

Return a semantic error the model can read and recover from. order_id_not_found, permission_denied, rate_limit_exceeded. Never return null. Never return an empty object with no explanation.

Null is not an error message. It is an invitation to hallucinate.

Question 3: Is it typed and token-efficient?

Define input and output with Pydantic or JSON Schema. Never dump raw database rows into the context. Half the columns are noise and every one costs tokens.

Tool descriptions are prompts. The model scores tools against descriptions, not against your internal API docs. See your agent called the wrong tool for registry fixes.

Conclusion

Get atomic, honest, and typed right and the agent that was failing yesterday starts working without touching the model. Stop debugging agents. Start building better tools.

Key takeaways

  • 1When an agent misbehaves, the instinct is to fix the prompt or the model. More often the fault is the tool. An AI tool is not a function, it is a contract the model has to trust.
  • 2Question one: is it atomic? One tool equals one verb. If a tool does two things, the model has to reason about which half it wants and it gets that reasoning wrong. Split it immediately.
  • 3Question two: what happens on failure? Return a semantic error the model can read and recover from, like order_id_not_found. Never return null. Null tells the model nothing and it will hallucinate a reason.
  • 4Question three: is it typed and token-efficient? Define the input and output with Pydantic or JSON Schema. Never dump raw database rows into the context. Half the columns are noise and every one of them costs tokens.
  • 5A good tool is atomic, honest on failure, and typed. Get those three right and the agent that was failing yesterday starts working without touching the model at all.
  • 6The golden rule: build tools your agent can actually trust. Stop debugging agents and start building better tools. Fix the tool, fix the agent.

Frequently asked questions

Work with me

Need help shipping this in production?

I help teams design agent architectures, RAG pipelines, and production guardrails on consulting engagements.

Tool design consulting Agentic AI training programs
Tags
#ToolDesign#AITools#AgenticAI#Pydantic#JSONSchema#ToolContracts#AIAgents

Get the visual notes by email

New agentic AI notes and breakdowns, plus what I am shipping for clients, one email on Thursdays.