get_complete_trace
Retrieve full trace details and metrics using a specific trace_id to debug and analyze AI agent performance in AgentOps MCP.
Instructions
Reserved for explicit requests for COMPLETE or ALL data. Get complete 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:328-360 (handler)Handler for the 'get_complete_trace' tool. Fetches trace info and metrics, then recursively fetches full span info and metrics for each span in the trace.case "get_complete_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 parentTrace = { ...traceInfo, metrics: traceMetrics }; if (parentTrace.spans && Array.isArray(parentTrace.spans)) { for (let i = 0; i < parentTrace.spans.length; i++) { if (parentTrace.spans[i].span_id) { const span_id = parentTrace.spans[i].span_id; const [childSpanInfo, childSpanMetrics] = await Promise.all([ makeAuthenticatedRequest(`/public/v1/spans/${span_id}`), makeAuthenticatedRequest(`/public/v1/spans/${span_id}/metrics`), ]); parentTrace.spans[i] = { ...childSpanInfo, metrics: childSpanMetrics, }; } } } return { content: [ { type: "text", text: JSON.stringify(parentTrace, null, 2), }, ], }; }
- src/index.ts:209-223 (registration)Registration of the 'get_complete_trace' tool in the listTools response, including input schema.{ name: "get_complete_trace", description: "Reserved for explicit requests for COMPLETE or ALL data. Get complete trace information and metrics by trace_id.", inputSchema: { type: "object", properties: { trace_id: { type: "string", description: "Trace ID", }, }, required: ["trace_id"], }, },
- src/index.ts:213-222 (schema)Input schema for the 'get_complete_trace' tool.inputSchema: { type: "object", properties: { trace_id: { type: "string", description: "Trace ID", }, }, required: ["trace_id"], },