Skip to main content
Glama

get_span

Retrieve detailed span information and metrics using a specific span ID for enhanced observability and debugging of AI agent runs with AgentOps MCP.

Instructions

Get span information and metrics by span_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
span_idYesSpan ID

Implementation Reference

  • The handler for the 'get_span' tool. It extracts the span_id from arguments, fetches span information and metrics via authenticated API requests to AgentOps, combines them, and returns the result as a JSON text content block.
    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)
    Registration of the 'get_span' tool in the list of available tools, including its name, description, and input schema requiring a 'span_id' string.
    { 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"], }, },
  • Input schema definition for the 'get_span' tool, specifying an object with a required 'span_id' string property.
    inputSchema: { type: "object", properties: { span_id: { type: "string", description: "Span ID", }, }, required: ["span_id"], },

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AgentOps-AI/agentops-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server