Skip to main content

Conversation with Tool Usage

This example shows how to capture tool calls and their results.

The Scenario

A customer is requesting a refund for a delayed order. The agent needs to look up the order and process the refund.

JSON

Key Points

Agent Definition

The agent is defined with its available tools, documenting what capabilities it had.

Multiple Steps

Message at sequence_number 3 has three steps:
  1. Step 0: Calls lookup_order tool
  2. Step 1: Calls process_refund tool
  3. Step 2: Generates the final response

Tool Call Structure

Tool Result Structure

What This Enables

With this structured data, you can evaluate:
  • Tool Selection: Did the agent use the right tools?
  • Argument Accuracy: Were the tool arguments correct?
  • Result Handling: Did the agent correctly interpret tool results?
  • Response Quality: Was the final response accurate and helpful?