Skip to main content
Glama

spans

Find individual spans matching filter criteria within a time range.

This is a DRILL-DOWN tool. For "where are errors / latency concentrated?" start with aggregate_spans, then use this to fetch example spans for a (service, operation).

Returns spans sorted by (timestamp, spanId) descending (newest first).

Returns the span's core fields by default; pass verbose=true to include its attributes (flattened in, plus a resource object). Long string values are capped (maxStringChars). For raw columns or custom selection use run_sql.

Defaults: from/to window open if none given; limit 100 (max 1000); all filters any. Common patterns:

  • Errored spans of an operation: statusCode="ERROR", name="http.client"

  • Slow spans: minDurationMs=500

  • Every span of a trace: traceId="..." (or use get_trace)

Returns: spans[], nextCursor (null on last page), queryStats.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoEnd of window, ISO-8601 instant (exclusive)
fromNoStart of window, ISO-8601 instant (inclusive)
kindNoFilter by kind: SERVER, CLIENT, PRODUCER, CONSUMER, INTERNAL
nameNoFilter by operation/span name (e.g. 'GET /things')
limitNoMax spans, default 100, max 1000
cursorNoOpaque cursor from a previous next_cursor
serviceNoFilter by service name
traceIdNoFilter to a single trace id
verboseNoReturn full spans incl. attributes and resource. Default false.
statusCodeNoFilter by status: UNSET, OK, ERROR
minDurationMsNoOnly spans at least this many milliseconds long
maxStringCharsNoMax characters of any attribute string value before truncation. Omit to use the server default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. First observed

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly. It discloses sorting order, default response fields, verbose behavior, string truncation, default time windows, limit defaults, and filter semantics. It also outlines the return structure (spans, nextCursor, queryStats), exceeding typical expectations.

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 well-organized with clear sections and front-loaded purpose. Every sentence contributes useful information, including common patterns and return details. Despite its length, it avoids redundancy and remains structured and scannable.

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

Completeness5/5

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

Given the tool's complexity (12 optional parameters, no output schema), the description is remarkably complete. It explains return values, default behaviors, filter semantics, and provides practical examples. It also covers when to use sibling tools, making it self-contained for effective selection and invocation.

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

Parameters4/5

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

Schema description coverage is 100%, so baseline is 3. The description adds contextual value beyond the schema by illustrating parameter usage with examples (e.g., statusCode='ERROR', name='http.client', minDurationMs=500, traceId) and explaining default behaviors for limit, from/to, and verbose. It doesn't deeply elaborate every parameter, but the extra semantic context justifies a 4.

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 clearly states the tool's function with a specific verb and resource: 'Find individual spans matching filter criteria within a time range.' It also distinguishes itself from siblings by explicitly positioning as a drill-down tool and referencing aggregate_spans and run_sql.

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?

Provides explicit guidance on when to use this tool versus alternatives: 'For "where are errors / latency concentrated?" start with aggregate_spans' and 'For raw columns or custom selection use run_sql.' It also offers common usage patterns and mentions get_trace as an alternative for trace-level retrieval.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources