Read tool call logs
Summary
This guide reads the tool calls that an agent made. It lists the outcome of each tool call in one call, then reads the runs of one webhook or MCP tool with their filtered arguments and result. It does not cover how to add or change a tool; see Tools and MCP servers.
Facts
Steps
Set CALL_ID to the id of a call from listCalls.
Set AGENT_ID to the agent_id of that call.
1. List the tool outcomes of a call
Each item is one tool call of the call. state says how it ended, reason gives the registered
code of a call that did not succeed, and latency_ms is the time the run took. latency_ms is
null until the run has a result. timing is pre_call for the run of the agent’s before-call
tool, which the platform sent before it answered an inbound call; every other run is during_call.
Choose a webhook or MCP item to inspect, and set TOOL_ID to its
tool_id. A built-in end_call or transfer item has a null tool_id and has no runs to read.
If the page state is pending, wait poll_after_seconds, then read the list again. If it is
unavailable, the outcomes will not be produced; see Calls and results.
If next_cursor is not null, send it as cursor to read the next page.
2. Read the runs of one tool
The answer lists the failed and indeterminate runs of the tool in that call, newest first. Each
run has the same id as its item in listCallToolOutcomes. Leave out call_id to read the runs
of the tool across all calls of the agent in the time range.
arguments is what the model sent, and result is what the tool answered, both with credentials
filtered out. A run with timing: pre_call has no model arguments, because no model runs before the
call. http_status is the status of the webhook response. The ToolRun schema in the
API Reference describes each field.
Rules
- MUST NOT run an
indeterminatetool call again automatically. Its effect is unknown: check the other system before you repeat the action. - MUST keep unknown
kind,stateandreasonvalues, and treat them as unknown, never as success. - MUST send the same filters and
limitwith acursor. A cursor expires after 24 hours. - MUST repeat
stateonce for each value. The API refuses an invalid filter withinvalid_request; it does not ignore it. - MUST read
argumentsandresultas nullable. Both arenullfor a run recorded while their capture was off, and the matching_truncatedfield isnulltoo.resultis alsonullfor a run that was refused, timed out, was uncertain or was too large. - MUST read
http_statusas nullable. It isnullfor an MCP tool and when no response arrived. - If
arguments_truncatedorresult_truncatedistrue, the field holds only_truncated_json: a filtered JSON prefix, not a complete object. MUST NOT parse it as the full payload. - A run never holds a credential, a resolved header, a URL path or query, or a provider exception.
Verify
Expected output: the runs of the tool in that call, each with the id of an item from step 1.