Skip to main content
Glama
OpenTelemetry MCP Server

OpenTelemetry MCP Server

by traceloop

Search Spans Tool

search_spans_tool

Search individual OpenTelemetry spans with filters for service, operation, duration, errors, and LLM attributes to analyze specific operations or find spans with certain characteristics.

Instructions

Search for individual OpenTelemetry spans with optional filters.

Unlike search_traces, this returns individual spans rather than grouped traces, which is useful for analyzing specific operations or finding spans with certain characteristics (e.g., LLM tool calls with traceloop.span.kind == tool).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "search_spans_tool"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagsNoAdditional tag filters as key-value pairs
limitNoMaximum number of spans to return (1-1000, default: 100)
filtersNoGeneric filter conditions - list of filter objects with: - field: Field name in dotted notation (e.g., "traceloop.span.kind") - operator: Comparison operator - value: Single value for most operators - values: List of values for "in", "not_in", "between" operators - value_type: Type of value(s) - "string", "number", or "boolean"
end_timeNoEnd time in ISO 8601 format
has_errorNoFilter spans with errors
start_timeNoStart time in ISO 8601 format (e.g., 2024-01-01T00:00:00Z)
service_nameNoFilter by service name
gen_ai_systemNoFilter by LLM provider (e.g., openai, anthropic)
operation_nameNoFilter by operation/span name
max_duration_msNoMaximum span duration in milliseconds
min_duration_msNoMinimum span duration in milliseconds
gen_ai_request_modelNoFilter by requested model name (e.g., "gpt-4")
gen_ai_response_modelNoFilter by actual model used (e.g., "gpt-4-0613")

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.2

TDQS

A4.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral-disclosure burden. It does clarify return granularity, individual spans versus grouped traces, but it does not state read-only safety, permissions, ordering, or pagination behavior.

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 two tightly written sentences with no wasted wording. The core distinction from search_traces is front-loaded before the supporting example.

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

Completeness4/5

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

The tool has 13 optional parameters and a rich input schema plus an output schema, so the description can rely on structured fields for most details. It covers the key sibling distinction and span-level use case, though it leaves some behavioral context such as pagination or safety implicit.

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?

Schema description coverage is 100%, so the input schema already documents all 13 parameters thoroughly. The description adds only a single example filter, traceloop.span.kind == tool, and otherwise does not add meaning beyond the schema.

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

Purpose5/5

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

The description states a specific verb and resource: searching individual OpenTelemetry spans. It also explicitly distinguishes this from search_traces by explaining that it returns individual spans rather than grouped traces.

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

Usage Guidelines5/5

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

It names the sibling alternative search_traces and clarifies the condition that selects this tool: when individual span-level analysis is needed. The example of finding LLM tool calls with traceloop.span.kind == tool makes the use case concrete.

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