Skip to main content
Glama
cloudsmithy

Easysearch MCP Server

by cloudsmithy

aggregate

Perform aggregation queries on search indices to group, analyze, and summarize data using terms, averages, date histograms, and multi-level aggregations.

Instructions

    执行聚合查询
    
    参数:
        index: 索引名称
        aggs: 聚合定义
        query: 过滤条件(可选)
        size: 返回文档数(默认 0,仅返回聚合结果)
    
    示例 - 分组统计:
        aggregate("orders", aggs={
            "by_status": {"terms": {"field": "status"}}
        })
    
    示例 - 多级聚合:
        aggregate("orders", aggs={
            "by_category": {
                "terms": {"field": "category"},
                "aggs": {
                    "avg_price": {"avg": {"field": "price"}}
                }
            }
        })
    
    示例 - 日期直方图:
        aggregate("logs", aggs={
            "by_day": {
                "date_histogram": {
                    "field": "@timestamp",
                    "calendar_interval": "day"
                }
            }
        })
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexYes
aggsYes
queryNo
sizeNo
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that 'size: 返回文档数(默认 0,仅返回聚合结果)' (returns document count, default 0, only returns aggregation results), which provides important behavioral context about the default behavior. However, it doesn't cover other important aspects like error conditions, performance characteristics, or what the actual return format looks like.

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 well-structured with a clear purpose statement followed by parameter explanations and three practical examples. Each example demonstrates a different use case. While comprehensive, it maintains focus without unnecessary verbosity. The Chinese text is direct and each section serves a clear purpose.

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?

For a tool with 4 parameters, 0% schema description coverage, no annotations, and no output schema, the description does an excellent job of explaining parameter semantics and providing usage examples. It covers the essential 'how-to' aspects well. The main gap is the lack of information about the return format, which would be particularly important given the complex nature of aggregation results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by providing clear parameter explanations in Chinese: '索引名称' (index name), '聚合定义' (aggregation definition), '过滤条件(可选)' (filter conditions, optional), and '返回文档数(默认 0,仅返回聚合结果)' (return document count, default 0, only returns aggregation results). The three detailed examples further illustrate how to use the 'aggs' parameter with different aggregation types.

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 clearly states the tool's purpose as '执行聚合查询' (execute aggregation query), which is a specific verb+resource combination. It distinguishes from obvious siblings like 'search' or 'count' by focusing on aggregation operations. However, it doesn't explicitly differentiate from 'aggregate_simple' which appears to be a sibling tool.

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 provides implied usage through the three examples showing different aggregation scenarios (grouping statistics, multi-level aggregation, date histogram). However, it doesn't explicitly state when to use this tool versus alternatives like 'aggregate_simple' or 'search', nor does it provide any exclusion criteria or prerequisites.

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/cloudsmithy/easysearch-mcp-server'

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