How do you design tool definitions so an LLM agent uses them correctly?
What the interviewer wants to hear
- Clear names and descriptions with when to use and not use
- Typed parameter schemas with formats and examples
- Few, non-overlapping tools
- Informative results and error messages
- Evaluate tool choice and arguments on test tasks
Model answer
The model only sees a tool's name, description and parameter schema, so I write them like good API docs for a new colleague. Each description says what the tool does, when to use it and when not to, and what it returns. Parameters have clear names, types, enums where possible, formats such as ISO dates, and short examples. I keep the set small and avoid overlapping tools; if two tools could both answer the same question, the model will pick inconsistently, so I merge them or sharpen the boundary. Results should be concise and relevant, not huge raw dumps, and errors should explain what went wrong so the model can retry correctly. Finally I build test tasks that check whether the agent chooses the right tool with valid arguments, and I read traces to find confusion.
Can you answer it under time pressure?
Take a timed medium round and get scored on every answer.
More medium Prompt Engineer questions
- How would you build an evaluation set for a prompt that writes replies to customer complaints?
- When would you split a task into a chain of prompts instead of one large prompt? What are the trade-offs?
- A marketing team wants all generated content to match their brand voice. How do you achieve consistency?
- How do you know when prompt engineering has reached its limit and another approach, such as RAG or fine-tuning, is needed?
- Write the outline of a system prompt for a banking support assistant. What sections would it include and why?
- Design the prompt and retrieval setup for a customer support bot that answers from a help centre. What choices matter most?
- Your LLM feature works well but is too slow and expensive. How would you reduce cost and latency without hurting quality?
- How would you handle personal data in an LLM workflow that processes customer emails?
- How would you set up regression testing for prompts so changes can be shipped safely?