LearnQuestion bank

Your agent has 40 tools and picks the wrong one too often. How do you design tool interfaces so the model uses them well?

Applied LLMTechnicalMedium

Answer it yourself first, out loud or on paper, then compare.

Answer

Model answer, written in a candidate's voice

In short

  • Collapse 40 thin wrappers into fewer higher-level tools with distinct names and model-facing descriptions
  • Add strict schemas, enums, examples, and explicit not-to-use guidance
  • Keep outputs concise and errors actionable; gate destructive or irreversible actions
  • Reduce tools visible per step via routing, retrieval, or sub-agents with small toolsets
  • Measure selection accuracy on labelled tasks and iterate from failure traces

In full

I would treat tool count as a design problem, not a capability problem: start by collapsing the 40 thin wrappers into a small set of higher-level tools whose names and descriptions are written for the model, including what the tool does, when it should not be used, and a few examples. Each tool gets a strict schema with enums and required fields, and returns concise, model-readable results with errors that say what failed and what to do next. I would also make dangerous or irreversible operations explicit and gated, with confirmation or a separate approval step rather than letting the model infer risk. To keep the model from choosing among too many options at once, I would route by task, retrieve only relevant tools, or use sub-agents with small toolsets. Finally, I would build a labelled set of tasks with the correct tool and measure selection accuracy, then review failure traces and rewrite descriptions, schemas, or tool boundaries until the errors stop repeating.

Corrected by an independent AI reviewer.

What a strong answer covers

  • Distinct names; descriptions written for the model, including when not to use the tool; strict schemas with enums; examples
  • Fewer, higher-level tools rather than thin wrappers of every endpoint; concise, model-readable outputs; actionable error messages
  • Reduce tools per step: routing, tool retrieval, sub-agents with small toolsets
  • Measure tool-selection accuracy on labelled tasks; iterate from failure traces
  • Make dangerous operations explicit and gated

Common mistakes

  • Mirroring a REST API one-to-one as tools
  • returning huge raw JSON