Skip to main content
Glama
vanovarderesyan

Elastic MCP Server

aggregate_logs

Run log aggregations to find top values, trends over time, and min/max/avg stats. Filter by service or custom fields to analyze specific log subsets.

Instructions

Run aggregations on logs: terms (top values), date_histogram (trends over time), stats (min/max/avg), count. Supports service filtering.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNoEnd time, e.g., "now"
fromNoStart time, e.g., "now-1h"
fieldYesField to aggregate on
indexNoIndex pattern, e.g., "logs-*", "filebeat-*"*
queryNoFree text query string (Lucene syntax)
aggTypeYesAggregation type
filtersNoKey-value field filters
serviceNoFilter by kubernetes.container.name, e.g., "my-service"
intervalNoInterval for date_histogram, e.g., "1h", "1d"1h
timeFieldNoTimestamp field name@timestamp
messageQueryNoSearch text within the message field (match_phrase)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only says 'Run aggregations' and does not state that the operation is read-only, that it returns aggregated buckets rather than raw documents, or any permission/time-range constraints.

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?

Two sentences with zero filler. The core capability and aggregation types are front-loaded, and the service-filtering note is a useful secondary detail. Every phrase earns its place.

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

Completeness3/5

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

For an 11-parameter tool with no annotations and no output schema, the description is thin: it does not describe the return shape, default index behavior, or how it relates to search_logs. The schema documents parameters well, but non-parameter context (output, safety, usage boundaries) is missing.

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%, which sets a baseline of 3, but the description adds real value by explaining the aggType enum semantics: terms=top values, date_histogram=trends over time, stats=min/max/avg. It also highlights the service filtering parameter, which is one of many schema fields.

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?

States a specific verb and resource ('Run aggregations on logs') and enumerates four aggregation types with intuitive glosses (top values, trends over time, min/max/avg). This clearly distinguishes it from sibling tools like search_logs (raw retrieval) and list_indices/get_mapping (metadata).

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

Usage Guidelines3/5

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

The description implies usage through phrases like 'trends over time' and 'top values', which hint at analytical use cases. However, it never explicitly says when to use this tool instead of search_logs, nor does it name alternatives or exclusion conditions.

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