Agent tool choice FAQ
How do you test which tool an AI agent calls first?
Ask an agent to find one invoice, then to list a customer’s invoices. Give it both lookup tools and see which it calls first for each request. Check the returned records too.
Two invoice requests to compare
Use fictional records and tools that only look up invoices. Give the agent these requests in separate, fresh sessions:
- “Find invoice INV-1042.” Expect
get_invoicewith that invoice number. - “List invoices for Example Co.” Expect
list_customer_invoiceswith that customer name.
Keep the client, model, skills, and connected servers the same. Record the first call to either tool and the input it receives. If neither tool is called, record that too. Compare the returned invoices with your test records.
If the agent chooses the wrong lookup, try changing one description. For example, describe get_invoice as a lookup for one known invoice number. Repeat the same prompts from the same starting conditions, with the same number of attempts. Compare how often it picks the expected tool first and whether it returns the correct invoices.
What if the first call is wrong but the answer is right?
Keep both results: the first lookup was wrong, and the agent eventually found the right record. That tells you more than marking the whole run as a pass.
How do you tell if adding more MCP tools makes an agent worse?
Repeat the same requests with the smaller and larger tool sets. Count correct results and wrong tool calls in each set. Test requests that require a newly added tool separately.
For example, compare 12 tools with the same 12 plus four more. Choose requests that both sets can complete. Keep the model, agent settings, and shared descriptions unchanged, use fresh sessions, and give each request the same number of attempts. Alternate which set you test first.
A task can finish correctly after several wrong calls. Count those calls separately so you can see whether the extra tools made the agent's choices less reliable.