Skip to main content

Pattern · Agents

Task-shaped tools

Give the agent a few clear tools shaped around tasks, with strict schemas, instead of wrapping every API endpoint.

Say it in the interview

I design tools around tasks, not endpoints: a handful, each with a clear name, a description that says when to use it, and a strict schema my code validates. Reads run freely; anything that moves money or reaches a customer needs approval.

When to use it

  • Any agent or tool-calling system
  • An API with many overlapping endpoints

How it works

  1. Raw API, 14 endpoints → group by task → 3 task tools
  2. 3 task tools → Clear names and descriptions (when to use each)
  3. 3 task tools → Strict schemas (types, enums, required fields)
  4. 3 task tools → Read tools run freely
  5. 3 task tools → Action tools need approval

Trade-offs

  • Fewer wrong tool choices and shorter runs
  • More design work up front

Pitfalls interviewers probe

  • Dozens of overlapping tools
  • Free-text parameters where an enum would do
  • Letting the model act without validation

Practise it on these questions

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.