AI Engineering · LLM applications that ship
How do you design tool schemas for an agent?
Short answer
Make each tool do one thing, use typed and constrained parameters, write descriptions that explain when to use it, and return small structured results. Ambiguous schemas cause wrong tool choices.
The schema is the model's only map of what a tool does. If two tools overlap, or a parameter is a free-text string where an enum would work, the model will guess. Good schemas reduce the search space and make failures obvious.
- Use enums, formats and ranges instead of free-form strings wherever possible.
- State when to use the tool and when not to, including prerequisites.
- Return compact structured output with stable field names and explicit error codes.
- Avoid one mega-tool with a mode switch; separate tools are easier to reason about.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1How would you fix two tools that the model keeps confusing?
- 2Should a tool return raw API JSON or a trimmed shape?
- 3How do you version a tool schema without breaking running agents?
Say it in the interview
I design tools the way I would design an API for a new engineer: one clear job, typed parameters, and a description that says when to use it. Enums and ranges are better than free text because they stop the model guessing. I return a small structured result with stable error codes, so the agent can recover. If two tools overlap, I either merge them or rename them so the choice is unambiguous.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live AI Engineering mock interview and get scored feedback on depth, clarity and confidence.