trace_record
Record an agent or MCP tool call span to a trace, capturing latency, token usage, and errors for a given run. Use the same run_id for all spans in a user turn.
Instructions
Append one agent or MCP tool span. Reuse run_id for every span in the same user turn.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"agent": "<agent>",
"tool": "<tool>"
},
"name": "trace_record"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| tool | Yes | ||
| agent | Yes | ||
| error | No | ||
| run_id | No | ||
| tokens_in | No | ||
| latency_ms | No | ||
| tokens_out | No | ||
| args_preview | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |