Skip to main content
Glama
AgentOps-AI

AgentOps MCP

Official
by AgentOps-AI

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
NameRequiredDescriptionDefault
span_idYesSpan ID

Implementation Reference

  • 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"],
      },
    },
  • 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"],
    },
Install Server

Other 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