get_trace
Retrieve detailed trace information and metrics using a trace ID to debug and analyze complex AI agent runs, providing insights into success or failure points.
Instructions
Get trace information and metrics by trace_id.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trace_id | Yes | Trace ID |
Implementation Reference
- src/index.ts:294-309 (handler)Handler for the 'get_trace' tool. Extracts trace_id from arguments, fetches trace information and metrics via authenticated API calls to AgentOps, combines them, and returns as formatted JSON.case "get_trace": { const { trace_id } = args as { trace_id: string }; const [traceInfo, traceMetrics] = await Promise.all([ makeAuthenticatedRequest(`/public/v1/traces/${trace_id}`), makeAuthenticatedRequest(`/public/v1/traces/${trace_id}/metrics`), ]); const result = { ...traceInfo, metrics: traceMetrics }; return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:184-194 (schema)Input schema for 'get_trace' tool, defining trace_id as a required string.inputSchema: { type: "object", properties: { trace_id: { type: "string", description: "Trace ID", }, }, required: ["trace_id"], }, },
- src/index.ts:182-194 (registration)Registration of the 'get_trace' tool in the ListTools response, including name, description, and input schema.name: "get_trace", description: "Get trace information and metrics by trace_id.", inputSchema: { type: "object", properties: { trace_id: { type: "string", description: "Trace ID", }, }, required: ["trace_id"], }, },