Skip to main content
Glama
techskies11

datadog-mcp

by techskies11

aggregate_spans

Read-onlyIdempotent

Aggregate APM spans by any field to compute latency percentiles, error counts, and averages. Get performance statistics without transferring raw span data.

Instructions

Aggregate spans by a field for latency/error statistics (no raw span data transfer).

PERFECT for "what's slow" or "what's erroring" questions without paying the cost of fetching and reading raw spans with search_apm_traces.

Use this when:

  • "p95 latency by service"

  • "Error count by endpoint"

  • "Average duration per operation"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of groups to return (default: 10)
queryYesSearch query using Datadog APM span search syntax
metricNoField to aggregate for non-count aggregations (e.g. "@duration")
to_timeYesEnd time - same accepted formats as from_time
group_byYesFacet to group by (e.g. "service", "resource_name", "@http.status_code")
from_timeYesStart time - ISO 8601, relative date math (e.g. "now-1h"), or a millisecond timestamp
aggregationNoAggregation function - count, avg, cardinality, median, pc75, pc90, pc95, pc98, pc99, sum, min, maxcount

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and destructiveHint=false. The description adds valuable context: 'no raw span data transfer' clarifies it performs server-side aggregation without returning raw data, which is a key behavioral trait beyond the annotation safety profile.

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-structured and front-loaded: first sentence delivers the core purpose, second explains the key advantage, and the bullet list gives concrete use cases. Every sentence earns its place; no fluff or redundancy.

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 (7 params, 4 required), the presence of an output schema, and comprehensive annotations, the description fully covers purpose, usage, behavioral nuance, and relevant alternatives. It leaves no critical gaps for an agent to resolve independently.

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?

Input schema covering all 7 parameters with descriptions gives a baseline of 3. The description's examples implicitly reference group_by and aggregation (e.g., 'p95 latency by service') but add no new parameter-level meaning beyond the schema, so no higher score is warranted.

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 'Aggregate spans by a field for latency/error statistics' and explicitly notes it does not transfer raw span data. It distinguishes itself from the sibling tool search_apm_traces by contrasting aggregation vs. raw span fetching.

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 when-to-use guidance with concrete example queries ('p95 latency by service', 'Error count by endpoint'), and names the alternative search_apm_traces while highlighting the cost trade-off of fetching raw spans. The 'Use this when' bullet list makes context crystal clear.

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/techskies11/datadog-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server