Skip to main content
Glama

Aggregate

aggregate
Read-onlyIdempotent

Compute exact Graylog counts, time histograms, top field values, or grouped errors to size a problem and find when it started.

Instructions

Exact counts computed by Graylog. kind='count': number of matching messages, cheap, to size a problem. 'histogram': counts over time with the peak, first/last non-empty bucket and the 'onset' of a spike, to find when a problem started. 'top': top values of the group_by field with counts and percentages. 'errors': errors (configured error query) grouped by exception, logger, source or any field, with first/last seen and a sample message per group.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "kind": "<kind>"
    },
    "name": "aggregate"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindYesWhat to compute
limitNotop/errors: number of groups (default 10)
queryNoLucene query, '*' by default; for 'errors' ANDed with the error query
rangeNoRelative range: '15m', '2h', '1d'; 15m for count, else 1h
samplesNoerrors: one sample message per group (default true)
streamsNoStream titles or ids; default the repository's focus, else all. ['*'] for everything
to_timeNoAbsolute end; default now
group_byNotop: the field (required); errors: 'exception' (default), 'logger', 'source' or a field
instanceNoInstance from describe, e.g. 'payment/prod'; the default when omitted
intervalNohistogram: bucket size such as '5m'; automatic
from_timeNoAbsolute start, overrides range: ISO 8601 or 'YYYY-MM-DD HH:MM'

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.1

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and non-destructive, so the description correctly focuses on behavior beyond them: the 'cheap' cost signal for count, the fact that histogram surfaces peak, first/last non-empty bucket and spike onset, and that errors returns first/last seen plus one sample message per group. This fills the gap left by having no output schema.

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?

One dense but well-structured passage where each clause is keyed to a kind and front-loaded with what is computed and why it matters. The 'kind=X: purpose, output' pattern makes it scannable and there is no filler.

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?

With 11 parameters and no output schema, the description supplies the per-kind result shapes and mode applicability that would otherwise be unknown. Remaining details such as instance/stream resolution and timing defaults live in the schema, so the description is nearly complete but leaves resolution behavior implicit.

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 coverage is 100%, so the baseline is 3, but the description adds cross-parameter meaning the schema lacks: which parameters apply to which kind (group_by is the required field for 'top' and selects exception/logger/source for 'errors', limit and samples are top/errors-only, query is ANDed with the error query for 'errors').

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

Purpose4/5

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

The description names the resource (counts computed by Graylog) and precisely decomposes the four modes with what each returns: message counts, time buckets with peak/onset, top field values with percentages, and errors grouped by exception/logger/source. It does not differentiate the tool from siblings like search_logs or root_cause, which keeps it from a 5.

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?

Each kind is framed by intent: 'count' is cheap and used 'to size a problem', 'histogram' is for finding 'when a problem started', 'top' for value distributions, 'errors' for grouped exception triage. It does not state when to prefer a sibling tool or when not to use this one, so no 5.

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