get_trace
Retrieve detailed trace information and performance metrics using a trace ID to debug and analyze AI agent execution within the AgentOps MCP server.
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)The handler for the 'get_trace' tool. It takes a trace_id, fetches trace information and metrics from the AgentOps API endpoints, combines the results, and returns them as a JSON-formatted text response.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:181-194 (registration)Registration of the 'get_trace' tool in the list of available tools, including its name, description, and input schema requiring a 'trace_id' string.{ 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"], }, },
- src/index.ts:184-193 (schema)Input schema definition for the 'get_trace' tool, specifying an object with a required 'trace_id' property of type string.inputSchema: { type: "object", properties: { trace_id: { type: "string", description: "Trace ID", }, }, required: ["trace_id"], },