trace_step
Record a single step in an agent trace, capturing tool name, input, output, optional token count and latency for inspection and debugging.
Instructions
Record a single step within a trace. Captures tool name, input, output, optional token count and latency. Example: { "trace_id": "abc-123", "tool_name": "web_search", "input": {"query": "hello"}, "output": {"results": ["a","b"]}, "token_count": 50, "latency_ms": 320 }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | Input payload passed to the tool. Example: { "query": "weather in Paris" } | |
| output | Yes | Output/result returned by the tool. Example: { "result": "Sunny, 22°C" }. Add "error" field or "isError": true to flag errors. | |
| trace_id | Yes | ID of the trace to record this step under. Example: "abc-123-def-456" | |
| tool_name | Yes | Name of the tool or action that was executed. Example: "web_search" or "llm_call" | |
| latency_ms | No | Optional wall-clock latency of this step in milliseconds. Example: 450 | |
| token_count | No | Optional number of tokens consumed in this step. Example: 150 |