tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Agentic AI > ADK Agent Testing > Testing ADK Agent Tool Call Sequences and Arguments

Testing ADK Agent Tool Call Sequences and Arguments

Author: Venkata Sudhakar

ADK agents coordinate multiple tools to handle complex ShopMax India requests. A cancellation flow might call get_order_details first, then validate_cancellation_eligibility, then submit_cancellation, in that exact sequence. If the agent skips a step or passes a wrong argument, the operation fails silently or produces an incorrect result. Testing tool call sequences and arguments ensures the agent orchestrates tools correctly for every supported flow.

Tool call sequence tests record every call made to each mock tool - including the tool name, the arguments passed, and the call order. After the agent runs, the test asserts that the tools were called in the expected order with the correct arguments. This catches bugs where the agent calls tools out of sequence, uses a stale argument from a previous turn, or skips a required validation step.

The example below simulates a ShopMax India order cancellation flow and asserts that the three required tools were called in the correct order with the order ID extracted from the customer query.


It gives the following output,

Tool call sequence: ['get_order_details', 'validate_cancellation', 'submit_cancellation']
Response: Order ORD-7821 cancelled. Refund in 5 days.
.. (2 passed in 0.01s)

In production, use the ADK event stream to capture actual tool invocations during integration tests instead of a manual call log. Assert on both the sequence and the argument values, not just presence, since an agent that calls the right tool with the wrong order ID is as broken as one that skips the tool entirely. Build a golden sequence file for each supported flow and compare against it automatically in CI to catch regressions when the agent prompt is updated.


 
  


  
bl  br