AI agents
Tool Schema Design and Agent Affordances
Create tool interfaces whose names, parameters, outputs, and errors support reliable model decisions.
By the end you can
- Define agent tool affordances as an operational contract rather than a capability label
- Contrast Broad convenience tool with Narrow composable tools in “A support agent chose close_ticket when it meant ‘finish drafting’”
- Trace “Poor affordances make invalid behavior look reasonable” through a concrete execution path
- Produce “Review one tool as a product interface” with evidence for “Agents select the intended tool under paraphrased instructions”
The description is where tool selection is actually decided
A tool schema is part of the agent's action space and documentation. Names, descriptions, field constraints, defaults, and result envelopes shape which actions the model considers and how it interprets outcomes.
Good affordances reduce ambiguity rather than compensating for it with longer prompts. Separate actions that differ in consequence, authority, latency, or reversibility.
The description is not documentation. It is what the model reads at the moment it decides. Anthropic's tool-use documentation says so: “Claude determines when to call a tool based on the user's request and the tool's description”. Leave a required parameter out and nothing stops. Claude “might also infer a reasonable value”.
Schema design has hard edges too. Microsoft's guidance on structured outputs is blunt about them. “All fields must be required”. “Always set additionalProperties: false in objects”. And a ceiling on the whole thing: “A schema can have up to 100 object properties total, with up to five levels of nesting.”
How much weight that leaves on the description has been measured. MetaTool collected names and descriptions for 390 tools and built ToolE, a dataset of 21,127 user queries. That was in 2023. It split tool selection into four subtasks: similar choices, specific scenarios, possible reliability issues, and multi-tool. Across eight evaluated LLMs, selection stayed unreliable. The recommendation the paper closes on is not aimed at the model: “we strongly recommend that tool developers choose an appropriate rewrite model for generating new descriptions based on the downstream LLM the tool will apply to.” Twenty-one thousand queries later, the artifact to fix is the sentence a developer wrote about the tool.
A vague description does not produce an error; it produces a plausible guess at the parameter nobody was asked to supply.
Visual
Defects arrive in the same order the schema reads
Purpose, arguments, consequences, results — a tool schema reads in that order. So do its defects, and the order is not cosmetic.
That order has a price you can look up. A 2024 study measured it directly. For gpt-4o-mini-2024-07-18 it reports exact-match accuracy on GSM8K of 94.57 in natural language against 86.95 in JSON mode. On Last Letter Concatenation the same comparison is 83.11 against 76.00. The cause of the Last Letter collapse was which key the schema invited the model to emit first: “Upon inspection, we found that 100% of GPT 3.5 Turbo JSON-mode responses placed the “answer” key before the “reason” key, resulting in zero-shot direct answering instead of zero-shot chain-of-thought reasoning.” Not most responses. All of them.
A field order is therefore a behavior, not a formatting preference. Read the schema in its own order, and give results and errors different owners and different tests.
- 1
Purpose
One clear capability stated in domain language.
- 2
Arguments
Typed fields with stable identifiers, units, and bounded ranges.
- 3
Consequences
Declared side effects, reversibility, and required authority.
- 4
Results
Structured data, status, provenance, and next valid actions.
- 5
Errors
Actionable classes that distinguish retry, repair, escalation, and refusal.
Key idea
Poor affordances make invalid behavior look reasonable
If the only available tool combines lookup, mutation, and notification, the model cannot choose a safer partial action. Optional booleans and generic payloads create hidden modes that are difficult to evaluate.
On 28 February 2017 an Amazon S3 team member mistyped one input to a capacity-removal command in the US-EAST-1 region. The person was authorized. The playbook was established. The command took down far more servers than intended, and S3 was broken for roughly four hours. Everything about the operator was in order. The argument space was the defect. AWS did not retrain the person. In its own service disruption summary it narrowed the tool: “We have modified this tool to remove capacity more slowly and added safeguards to prevent capacity from being removed when it will take any subsystem below its minimum required capacity level.” A bounded rate and a floor. Those are the same two edits a tool catalog needs before an agent is pointed at it.
Design the tool catalog around meaningful decisions. Not around existing internal endpoints.
When the catalog offers no safer partial move, the agent is left choosing between doing too much and doing nothing, and both will read as a decision afterwards.
Example
One boolean in the tool's own metadata decides whether a human is asked
A tool, in the Model Context Protocol, is a name, an optional title, a description, an inputSchema, an optional outputSchema and optional annotations. Tools there are model-controlled: the model discovers and invokes them from its own reading of the context. Consequence is declared in the annotations. Revision 2025-06-18 of the specification is explicit about how far that declaration goes: “For trust & safety and security, clients MUST consider tool annotations to be untrusted unless they come from trusted servers.”
A shipped client acts on the hint anyway. Microsoft 365 Copilot drops the per-use confirmation dialog for any tool whose tools/list response sets readOnlyHint to true. The initial first-time prompt still appears. The dialog that would otherwise follow it does not. Microsoft Learn puts it plainly: “Developers can control whether Microsoft 365 Copilot asks the user for confirmation … by setting the readOnlyHint property to true”. It adds that “any action with side effects in the external system should be marked with true to ensure the user is in control”.
So the schema does not merely describe the action. One field, filled in by the tool's author, decides whether a person sees the action before it runs. The protocol tells clients not to trust that field. The model reaching for the tool reads the same metadata as its instructions.
- Decision at stake: whether a human is asked before an action runs — in Microsoft 365 Copilot that is settled by readOnlyHint in the tool's own tools/list response, not by the prompt.
- Hidden assumption: that a declared annotation is a fact about the tool. Revision 2025-06-18 of the Model Context Protocol specification says clients MUST consider tool annotations untrusted unless they come from trusted servers.
- Primary control question: poor affordances make invalid behavior look reasonable. Tools are model-controlled, discovered and invoked from the model's own reading of the context, so the metadata is the whole briefing.
- Evidence to collect: agents select the intended tool under paraphrased instructions, and the consequence annotations on the tools they select match what those calls actually change.
Example
How to know whether agent tool affordances is working
Measure “Agents select the intended tool under paraphrased instructions” first, because paraphrase is what real traffic looks like. “Invalid parameter combinations cannot pass schema validation” is checked on its own. Two further claims hold up only under repetition and attack: “Results contain the evidence needed for downstream decisions” and “Tool descriptions remain accurate when backend behavior changes”.
Repetition has a published number. τ-bench introduced pass^k in 2024. The metric requires the same task to succeed on all k independent trials: “Our experiments show that even state-of-the-art function calling agents (like gpt-4o) succeed on <50% of the tasks, and are quite inconsistent (pass^8 <25% in retail).” Under 50% once. Below 25% eight times in a row. That spread is the distance between a demo trace and a tool you can route traffic through.
For selection and validity there is a public leaderboard to measure against. The Berkeley Function Calling Leaderboard, published at ICML 2025, evaluates function calls with an Abstract Syntax Tree method that scales to thousands of functions. It also scores not calling as an action: “Finally, BFCL benchmark evaluates the ability of models to abstain and reason in stateful multi-step agentic setting.” Restraint stops being an unmeasured virtue. Its finding maps the work that is left. State-of-the-art LLMs handle single-turn calls well. Multi-step decision-making stays open.
- Signal 1: Agents select the intended tool under paraphrased instructions — BFCL's Abstract Syntax Tree evaluation scales this to thousands of functions and scores abstention alongside calling.
- Signal 2: Invalid parameter combinations cannot pass schema validation — Microsoft's strict mode makes that structural: all fields required, additionalProperties set to false, at most 100 object properties and five levels of nesting.
- Signal 3: Results contain the evidence needed for downstream decisions — verified under repetition rather than once, the way pass^8 dropped gpt-4o below 25% in τ-bench's retail domain.
- Signal 4: Tool descriptions remain accurate when backend behavior changes — MetaTool's recommendation is that developers rewrite descriptions for the downstream LLM, which requires someone to own the description as an artifact.
Steps
Review one tool as a product interface
Review one tool the way a product team reviews a screen. Read its name and its fields as the only instructions anyone will get. For a model-controlled tool that is literally true. The review should surface the places where poor affordances make invalid behavior look reasonable: a field whose name invites the wrong value, an option that reads as harmless and is not, a key whose position changes what the model does before it answers.
Two of the steps below have already been done once under real consequences. After 28 February 2017 AWS constrained the capacity-removal command so it removes capacity more slowly. It also removed the hidden mode in which a subsystem could be taken below its minimum required capacity level. Neither fix was a better instruction to the operator.
Then reword a handful of requests and check that the agent still reaches for this tool rather than a neighbouring one. Check it the way τ-bench does: on all k trials, not on the one that went well.
- 1
Write the user-visible consequence
Describe what changes if the call succeeds.
- 2
Remove hidden modes
Split parameters that switch between materially different behaviors.
- 3
Constrain the vocabulary
Use enums and domain identifiers where free text adds no value.
- 4
Design result semantics
Return enough information to verify and choose the next step.
- 5
Publish failure guidance
State which errors are retryable, repairable, or terminal.
If a paraphrase changes the tool choice, fix the schema
A high-quality tool can improve reliability more than another reasoning prompt. It narrows the action space and makes failures legible to both model and operator. MetaTool reached that conclusion after 21,127 queries over descriptions collected for 390 tools. Its recommendation went to the people who write the descriptions, not to the model reading them.
So design the tool against the failure where bad behavior looks reasonable to the model. Then settle the question with paraphrase. Ask for the same thing in different words, repeatedly. Once is not a result: gpt-4o solved under 50% of τ-bench's tasks outright and fell below 25% at pass^8 in the retail domain. If the agent still picks this tool, the design held. If it does not, the schema is what needs changing, not the prompt.
Effort spent persuading the model is effort not spent removing the options that made persuasion necessary.
Key takeaways
- A tool schema is part of the agent's action space and documentation. MetaTool built ToolE from 21,127 user queries over names and descriptions collected for 390 tools, and still found selection unreliable across eight evaluated LLMs.
- Good affordances reduce ambiguity rather than compensating for it with longer prompts. MetaTool's own recommendation is that tool developers rewrite the description for the downstream LLM.
- Field order is behavior. For gpt-4o-mini-2024-07-18, JSON mode took GSM8K exact-match from 94.57 to 86.95, and 83.11 fell to 76.00 on Last Letter Concatenation. The reason: 100% of the JSON-mode responses inspected put the answer key before the reason key.
- Declared consequence is a claim, not a fact. Revision 2025-06-18 of the Model Context Protocol specification tells clients to treat tool annotations as untrusted, while Microsoft 365 Copilot drops the per-use confirmation dialog when readOnlyHint is true.
- Design the tool catalog around meaningful decisions, not around existing internal endpoints. After 28 February 2017 AWS did not retrain the operator. It made the capacity-removal tool slower and gave it a floor.
- A high-quality tool improves reliability more than another reasoning prompt, and reliability is measured repeatedly: gpt-4o solved under 50% of τ-bench tasks and fell below 25% at pass^8 in the retail domain.