Skip to main content
Glama

aggregate_spans

Aggregate spans into RED metrics: request count, error rate, throughput, and latency percentiles (p50/p90/p95/p99), grouped by operation and optionally its immediate parent.

START HERE for "where are errors / latency concentrated?", "what changed between two windows?", "is this operation slow?". By default this reads a pre-aggregated rollup, so it stays cheap over wide windows. Drill into raw spans (spans / get_trace) once this points you at a specific (service, operation).

Parent breakdown: the same operation behaves differently per caller. Add "parent_operation" to groupBy to split an operation by its immediate parent — e.g. "http.client" might be 8% errors overall but 92% under one caller and 0% under others. The parent breakdown is computed on demand over raw spans, so keep it scoped: pass a tight from/to and a service/name filter when using it.

Params: from, to: ISO-8601 window (required). step: "", units s m h d w mo y (e.g. "30s", "15m", "2h", "1d", "1w", "1mo", "1y") — omit for a single window per group. groupBy: any of service, operation, parent_operation (default service, operation). service / name: optional filters.

Returns buckets[], each with group, spanCount/okCount/errorCount/unsetCount, errorRate (percentage, 0-100), throughputPerSecond, avg/min/maxDurationNanos, and quantileNanos (p50/p90/p95/p99), plus queryStats.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesEnd of window, ISO-8601 instant (exclusive)
fromYesStart of window, ISO-8601 instant (inclusive)
nameNoFilter by operation name
stepNoTime bucket <amount><unit>, units: s m h d w mo y (e.g. 30s, 15m, 2h, 1d, 1w, 1mo, 1y); omit for one window
groupByNoGroup-by keys: service, operation, parent_operation
serviceNoFilter by service

TDQS

A5/5.0
Behavior5/5

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

With no annotations, the description fully explains behavioral nuances: by default it reads a pre-aggregated rollup for cheap wide-window queries, while the parent breakdown is computed on demand over raw spans and must be scoped. It also clarifies the returned metrics and percentage units, giving the agent a faithful model of what happens.

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 structured into clear sections: headline, usage guidance, parent-breakdown caveat, parameter list, and return shape. Every sentence adds value, and the examples are illustrative without being padded. It is appropriately detailed for a tool with six parameters and no output schema.

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 no output schema, the description fully enumerates the return fields (buckets, group, spanCount, errorRate, quantileNanos, queryStats, etc.). It also covers when to use the tool, how to scope expensive operations, and the meaning of all parameters, making the agent well-equipped to invoke it correctly.

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

Parameters5/5

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

The schema already covers the parameters at 100%, and the description goes well beyond that with concrete formats and defaults: step units, 'omit for a single window', default groupBy of 'service, operation', and the semantics of parent_operation. This adds practical meaning beyond the schema's property descriptions.

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 opens with a specific action and resource: 'Aggregate spans into RED metrics: request count, error rate, throughput, and latency percentiles...' It clearly states what the tool computes and the grouping dimension. It also distinguishes itself from sibling raw-span tools by explicitly pointing to 'spans / get_trace' for drill-down after aggregation.

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 gives explicit 'START HERE' guidance for common questions ('where are errors / latency concentrated?', 'what changed between two windows?', 'is this operation slow?'). It names alternatives ('Drill into raw spans (spans / get_trace)') and warns that parent breakdown is over raw spans and should be scoped with tight from/to and filters.

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.

TDQS

A3.8/5.0
Disambiguation2/5

Several tool pairs are near-duplicates, including three deprecated aliases (add_investigation_alert_channel vs add_alert_channel, list_investigation_alert_channels vs list_alert_channels, remove_investigation_alert_channel vs remove_alert_channel) that muddy the surface. Additionally, suppress_signal and create_ignore_rule both suppress alerting via different mechanisms, which could cause misselection despite detailed descriptions.

Naming Consistency4/5

The vast majority of tools follow a clear verb_noun snake_case pattern (create_api_test, list_issues, set_alert_rule_status). A few bare-noun tools (logs, spans, metrics) and the standalone verb correlate break the pattern slightly, but overall the naming is highly consistent and predictable.

Tool Count1/5

With 52 tools, this is on the extreme end of the calibration scale. Even accounting for the broad scope of an observability platform, the count is excessive and includes several deprecated redundancies that inflate it further.

Completeness5/5

The toolset provides comprehensive CRUD/lifecycle coverage across all major domains: alert rules (create, read, update, delete, status, delivery, preview), API tests (create, read, update, delete, run history, credentials), ignore rules and suppressions, issues with digest config, investigations with claim/read, channels, credentials, and rich query tools (logs, spans, metrics, SQL, traces, correlation). No obvious dead ends or missing core operations.

Resources