Skip to main content
Glama
techskies11

datadog-mcp

by techskies11

aggregate_logs_by_field

Read-onlyIdempotent

Aggregate Datadog logs by field to compute counts, averages, percentiles, or time-series per group for analytics and dashboards.

Instructions

Aggregate and group logs by a field with statistics (fast, no raw data transfer).

PERFECT for analytics, charts, and dashboards. Set interval to get a timeseries per group instead of a single scalar per group - this covers timeseries use cases without needing a separate tool.

Use this when:

  • "Group errors by service"

  • "Top 10 services by request count"

  • "Average duration per endpoint, per hour" (set interval="1h")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of groups to return (default: 10)
queryYesSearch query using Datadog log search syntax
metricNoMetric field for aggregations other than count (e.g. "@duration" for avg)
indexesNoOptional list of index names to search
to_timeYesEnd time - same accepted formats as from_time
group_byYesField to group by (e.g. "@airline_name", "service", "status")
intervalNoIf set (e.g. "5m", "1h", "1d"), returns a timeseries per group instead of a single scalar per group
from_timeYesStart time - ISO 8601, relative date math (e.g. "now-1h"), or a millisecond timestamp
aggregationNoAggregation function to apply within each groupcount

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

The description adds behavioral context beyond annotations: it advertises 'fast, no raw data transfer' and clarifies how setting interval changes the return shape to 'a timeseries per group instead of a single scalar per group'. This is useful information not present in the readOnly/idempotent hints.

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 tight and well-structured: the first sentence defines the tool, the second paragraph highlights use cases, and the bullet list provides concrete examples. Every sentence earns its place with no fluff.

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?

Given the tool's complexity (9 parameters, aggregation modes) and the presence of a full input schema plus an output schema, the description provides sufficient context. It explains the core aggregation behavior, interval option, and performance characteristics, making it easy for an agent to select and invoke correctly.

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 input schema already provides 100% coverage for all parameters, so the baseline is 3. The description does reinforce the interval behavior and gives an example with metric and interval, but it does not add new information beyond what the schema already states.

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: 'Aggregate and group logs by a field with statistics', with a specific verb, resource, and scope. It distinguishes itself from siblings like search_logs by mentioning 'no raw data transfer' and from simple count tools by focusing on grouped statistics.

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

Usage Guidelines4/5

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

It explicitly states 'PERFECT for analytics, charts, and dashboards' and provides concrete use cases via 'Use this when:' with example queries. It also notes that interval handles timeseries without a separate tool. However, it does not explicitly name alternatives or state when not to use the tool.

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