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"],
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a read operation ('Get'), which implies it's non-destructive, but doesn't address other aspects like authentication needs, rate limits, error handling, or what 'information and metrics' specifically includes. This leaves significant gaps for a tool that likely interacts with tracing data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It's front-loaded with the core purpose, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'span information and metrics' entails, how results are structured, or any behavioral traits like safety or performance. For a tool in a tracing context with siblings, more detail is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the single parameter 'span_id' clearly documented in the schema. The description adds minimal value beyond the schema by mentioning 'by span_id', but doesn't provide additional context like format examples or constraints. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and target resource ('span information and metrics'), making the purpose understandable. However, it doesn't distinguish this tool from its sibling 'get_trace' or 'get_complete_trace', which likely retrieve related but different data, so it doesn't achieve full differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_trace' or 'get_complete_trace'. It mentions 'by span_id', which implies a prerequisite but doesn't explain how this differs from sibling tools or when other tools might be more appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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