TL;DR: Do not mirror the endpoints. Expose one tool per decision the agent makes (
orders_recent,orders_get,orders_cancel,returns_start,shipping_track), each with a description that says when to use it and when not to, a few constrained arguments, no customer identity argument, and a compact result with the facts the next step needs. Then test selection on a labelled set of requests.
How to approach it
Ask what the agent is for before designing anything: a customer-facing support agent needs different tools from an internal operations agent with broader authority. Then ask which actions are irreversible or cost money, because those shape the arguments and the policy around them. Say out loud that you will design for a model reader, which rereads every definition on every turn.
A strong answer
Start from the customer's intents, not from the API's endpoints. A support agent for an online store serves a short list of decisions: find my order, where is it, cancel it, return it, why was I charged. Each becomes one tool:
| Tool | Decision | Arguments | Side effect |
|---|---|---|---|
orders_recent | Which orders is the customer talking about? | limit (1 to 20) | None |
orders_get | What is the state of this order? | order_id | None |
shipping_track | Where is the parcel? | order_id | None |
orders_cancel | Cancel before shipping | order_id, reason (enum) | Order cancelled, customer emailed |
returns_start | Return a delivered item | order_id, sku, reason (enum) | Return label created |
Three choices carry most of the value. Identity is not an argument. Every tool acts on the customer in the authenticated session; there is no customer_id for an injected instruction to set. Cancel and return are separate tools, because they have different rules and different consequences, and their descriptions point at each other ("for an item that has already arrived, use returns_start"). Reasons are enums, so the harness can apply policy per reason and the model cannot invent one.
Write one definition in full so the interviewer sees the detail:
name: orders_cancel
description: >
Cancel an order that has not shipped. For a delivered item use returns_start.
Fails with precondition_failed if the order has shipped. Side effect: the
customer is emailed a cancellation confirmation.
input_schema:
type: object
properties:
order_id: {type: string, pattern: "^ord_[0-9]{6}$"}
reason:
type: string
enum: [customer_request, duplicate_order, wrong_item_ordered]
required: [order_id, reason]
additionalProperties: false
Then design the results. orders_get returns status, a precomputed cancellable and returnable flag, the first few line items with a count, and the dates the customer will ask about, not the 30 KB internal record. When a list is truncated, the result says so and how to get more.
Finish with how you would know it works: a few hundred labelled requests, weighted toward ambiguous ones ("I want to send this back", "I changed my mind"), scored for which tool a correct agent calls. The confusion matrix tells you which descriptions to fix.
What interviewers probe next
"The API has 40 endpoints. Why only five tools?" Most endpoints are implementation steps (look up customer, list orders, fetch lines). Tools map to decisions; the steps happen inside the tool. Fewer, clearer tools mean fewer tokens per turn and fewer wrong choices.
"An operations agent needs to cancel shipped orders as an exception. Same tool?" A different tool with its own permission check (orders_force_cancel, available only to the operations agent's task and requiring an approval), so the customer-facing agent never sees it.
"How long should a description be?" As long as it takes to say what the tool does, when to use it instead of its nearest neighbour, how it fails and what it changes. Usually two to four sentences; the "when not to" clause is the one most often missing.
What if?
What if · interview follow-ups
Hold your answer as the constraints change
Your support agent has orders_recent, orders_get, orders_cancel and returns_start. Selection works well in testing.
Start here
What if customers often say 'cancel' about orders that have already arrived?
Which tool should the model reach for, and who corrects it?
Make orders_cancel's description say it only applies before shipping and to use returns_start afterwards, and have it fail with a precondition error that names returns_start. The model can then recover on its own, and the labelled set should include this phrasing.
Carry it forwardDescriptions and errors should both point at the right neighbour.
Weak answerLetting orders_cancel accept delivered orders and handle them as returns internally.
Constraint changes
What if product wants the agent to change delivery addresses too?
Is that a new decision or a field on an existing one?
A new tool, orders_change_address, with its own precondition (not yet dispatched) and a validated address object. Folding it into a generic orders_update would bring back the unconstrained write the design removed.
Carry it forwardNew decisions get new tools, not new modes on old ones.
Weak answerAdding an action parameter to orders_cancel.
Constraint changes
What if the agent starts serving business accounts that manage orders for many employees?
Identity just got more complicated.
The session now carries the user and their role on the account. Tools still take no identity arguments; the harness checks that the signed-in user may act on each order, which may now include orders placed by colleagues.
Carry it forwardAuthorization stays in the harness however the identity model grows.
Weak answerAdding an employee_id argument the model fills in.
Now defend it
What is the principle you would state to the interviewer?
One tool per decision the agent makes, described for a model that rereads it every turn, with identity and policy kept in the harness and results trimmed to what the next step needs, verified on a labelled selection set.
How it's scored
Weak: Lists the API's endpoints as tools, includes a customer or user id argument, and returns raw records.
Hire: Designs tools around customer intents, separates cancel from return, constrains arguments and keeps identity in the session.
Strong Hire: Writes a full definition with when-not-to-use guidance, precondition errors that name the right tool, designs compact results with precomputed flags and truncation notices, keeps privileged variants for other agents, and evaluates selection with a labelled, ambiguity-weighted set.
Common mistakes
- A generic
orders_update(order_id, fields)that lets the model guess field names and values. - Descriptions that say what a tool does but never when to use a different one.
- Treating the result format as an afterthought, then paying for oversized results on every later turn.
- Testing selection with the same handful of clear requests the demo used.