All articles
5 min readBy Ming Shin

The Prompt Is Not The Interface: Designing Tools An Agent Can Actually Use

A model experiences your product as a list of tool names, schemas and error messages. Why the tool layer decides more about agent behaviour than the prompt.

Agentic AIProductionWorkflow Automation

Ask a team where they spent the most time on their agent and the answer is usually the prompt. Weeks of wording, examples, reordering. Then the agent connects to real systems and the failures are not in the wording: it calls the wrong tool, invents a required field, gives up after one error, or dumps four thousand characters of JSON and answers a question about the third row.

The prompt is the part everyone can edit. The tool layer is what the model actually works inside, and it decides most of the behaviour.

What the model sees

To a language model, your product is not a website, an API, or a database. It is a list of function names, descriptions and JSON schemas, plus what those functions return. That is the whole interface: no documentation to browse, no colleague to ask, no UI affordance hinting at the next step.

So a tool named manage_account, described as “Manage the customer account”, is not a neutral abstraction. It asks the model to guess — which sub-action, which fields, in what order — and the guess becomes the behaviour your users meet. When a team says the model “isn’t smart enough to use our API”, the API was usually designed for a frontend that already knew the answer.

Write the description for a reader who cannot ask

Tool descriptions are read cold, at speed, by something that does not know your domain. Three things earn their space.

What it does and what it returns. “Returns the status of a single order, including shipping state and tracking number” tells the model when to call it and what it gets. “Order lookup” does not.

When not to use it. The negative case is where selection goes wrong. If search_orders matches on partial customer names and get_order requires an exact ID, say so — otherwise the agent will use the one that happens to sound closer to the request.

One tool, one intent. Name the action, not the subsystem: refund_order, send_reply_draft, lookup_invoice_pdf. A model choosing between update_ticket and modify_case learns nothing from either name.

Descriptions also carry the small facts that prevent whole classes of failure: maximum page size, whether amounts are cents or currency units, whether an ID must come from a previous call. Put them in the schema where possible, the description where not. A wrong-unit amount is a silent business error, and no prompt discipline catches it.

Granularity is a design decision

Two failure modes sit at opposite ends.

Too few, too broad: one update_record taking a free-form patch. The model has to reconstruct your internal schema from memory, and every field name is a coin flip — this is where invented columns and dropped fields come from.

Too many, too narrow: thirty endpoints exposed one-to-one, many of them steps inside a single intent. The model burns turns chaining calls, mis-selects between near-identical tools, and errors compound with each hop. Selection accuracy falls as the list grows and names converge; that is a design defect, not a model one.

The working shape is one tool per intent, with internal fan-out in code. “Get the customer with their last three orders and open balance” is one intent even if it is three queries. The agent should not orchestrate your database joins; each hop is another chance to drop context or time out.

Errors are the interface too

Most tool errors were written for a developer reading a log: a stack trace, a 500 with an HTML body, a bare {"error": "invalid"}. The model can only retry or apologise and stop.

A useful error distinguishes three cases, each with a different correct response.

Retryable. Rate limit, timeout, temporary unavailability. Say so, and say whether to wait. The agent should back off or defer, not rephrase and hammer.

Fixable. A missing field, a malformed date, a value outside the allowed set. Return which field, what was expected, and the accepted format. The model can often correct itself on the next attempt — the cheapest repair path available.

Terminal. The order does not exist, the customer is not permitted, the invoice is already paid. Retrying never works. Say that plainly so the agent escalates instead of spending four turns rediscovering it.

One rule holds across all three: never return success with a failure inside it. 200 OK with {"status": "failed"} teaches the agent to treat broken calls as done, invisibly until a customer notices.

Return values are context budget

Every tool result lands in the same window as the instructions, the conversation, and the previous results. A tool returning the full record because the database made that easy spends the agent’s attention on fields nobody asked about, and pushes the answer further from where the model decides what to do next.

Return what the intent needs: identifiers, the fields the next step requires, a count, and a token to fetch more. Paginate small by default and truncate long text with an explicit marker rather than silently. If a field exists in two formats, pick one; a model that sees created as a Unix timestamp in one response and an ISO string in another will eventually mix them.

Writes need a different contract

A bad read tool wastes a turn. A bad write tool creates a real-world event: a refund, an email, a status change.

So write tools should take the smallest surface — a target resolving to exactly one record, an amount, a reason — with explicit inputs rather than a patch object. They should also be safe to call twice, since retries and duplicate deliveries happen; that is the idempotency problem covered separately, and it belongs in the tool’s contract, not the agent’s good behaviour.

For consequential actions, split the tool into propose_refund and apply_refund, the second requiring the proposal’s ID. That gives you a review point, an audit record, and a place to enforce limits in code — plus a way for the model to state intent before anything happens.

Test the tool layer without the conversation

Tool behaviour is testable in a way prompts are not. Call every tool with missing arguments, wrong types, unknown IDs and oversized inputs, and check the agent recovers rather than spirals. Then measure selection: a fixed set of realistic requests, a fixed tool list, a score for picking the right tool with valid arguments. That number moves when you rename a tool or merge two endpoints, so it tells you whether an interface change helped before anyone ships.

Log the tool name and arguments for every call, not just the final answer. When output is wrong, the difference between “the model chose badly” and “the tool lied” is one glance at that log.

None of this is model work. It is API design for a new kind of client — one that reads the docs once, never asks a question, and takes every ambiguous name literally. Teams that treat their tool layer as a product surface get agents that behave; teams that treat it as plumbing get a prompt they keep rewriting. If that is the missing part of your rollout, it is where we usually start — see what we do.

Want this running in your business?

Start with an automation audit — we map the highest-value workflows and show you what an agent can take on.

Book an Audit