agents_trace_get
Fetch the full execution detail for a single trace — tool executions, events timeline, LLM call spans (with error_message on failures), and what the run cost.
cost_usd is the run's billed cost in USD, recorded even when the workspace pays with its own vendor key; 0 means nothing billable was recorded, null means the lookup could not run. Per-token detail is on each LLM span (input_tokens, output_tokens, cache_read_tokens, cache_creation_tokens).
Use after agents.traces_list identifies a specific trace of interest (failed run, slow run, unexpected outcome).
By default LLM system_prompt and prompt_messages are stripped — set include_llm_bodies=true to fetch them when diagnosing prompt engineering issues (emits a WARNING audit log). Set full=true to disable all field truncation. completion_text on failed LLM calls is always returned (capped at 8 KB).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| full | No | Disable all field truncation. Escape hatch for a human operator. OMIT for the standard truncated view. | |
| agent_id | Yes | Expected agent_id — used for scope validation. Mismatch returns not_found. | |
| trace_id | Yes | Trace identifier returned by agents.traces_list. | |
| in_workspace | No | Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected. | |
| include_llm_bodies | No | Include system_prompt and prompt_messages in LLM spans. Audited at WARNING level. OMIT to keep them stripped (the default). |