get_span
Retrieve detailed span information and performance metrics using a span ID to debug AI agent execution issues within the AgentOps MCP observability platform.
Instructions
Get span information and metrics by span_id.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| span_id | Yes | Span ID |
Implementation Reference
- src/index.ts:311-326 (handler)The handler function for the 'get_span' tool. It extracts the span_id from arguments, makes authenticated API requests to retrieve span information and metrics, combines them, and returns the result as JSON text.case "get_span": { const { span_id } = args as { span_id: string }; const [spanInfo, spanMetrics] = await Promise.all([ makeAuthenticatedRequest(`/public/v1/spans/${span_id}`), makeAuthenticatedRequest(`/public/v1/spans/${span_id}/metrics`), ]); const result = { ...spanInfo, metrics: spanMetrics }; return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:195-208 (registration)The registration of the 'get_span' tool in the list of available tools, including its name, description, and input schema.{ name: "get_span", description: "Get span information and metrics by span_id.", inputSchema: { type: "object", properties: { span_id: { type: "string", description: "Span ID", }, }, required: ["span_id"], }, },
- src/index.ts:198-207 (schema)The input schema definition for the 'get_span' tool, specifying the required 'span_id' parameter.inputSchema: { type: "object", properties: { span_id: { type: "string", description: "Span ID", }, }, required: ["span_id"], },