Skip to main content
Glama
bpamiri

elasticsearch-mcp

by bpamiri

terms_aggregation

Aggregate documents by a field to return the top values with counts, optionally filtered by a query.

Instructions

Get top values for a field (terms aggregation).

Args: index: Index to aggregate. field: Field to get top values for (must be keyword or numeric). size: Number of top terms to return (default: 10). query: Optional query to filter documents.

Returns: Top field values with document counts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexYes
fieldYes
sizeNo
queryNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

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

No annotations provided, so the description carries full burden. It states 'get' implying a read operation, but lacks details on mutability, authentication, rate limits, or other behavioral traits. The field constraint (keyword/numeric) is a minor addition.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise with clear sections (Args, Returns). However, the 'Args' section is a bit terse; each sentence earns its place. No wasted words.

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?

Given no annotations and an output schema (present but not detailed here), the description covers basic intent and parameters. It lacks context on when to choose this aggregation over others (e.g., `date_histogram`) and does not describe return format fully.

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 has 0% description coverage, so the description compensates well. It explains 'field' must be keyword/numeric, 'size' default 10, and 'query' optional. This adds meaning to parameters beyond the schema structure.

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?

Clearly states 'Get top values for a field (terms aggregation)', which is a specific verb and resource. It distinguishes itself from siblings like 'aggregate' (general) and 'date_histogram' (time-based).

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool vs alternatives like 'aggregate' or 'date_histogram'. The description only implies usage for terms aggregation but does not provide context or exclusions.

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/bpamiri/elasticsearch-mcp'

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