Skip to main content
Glama

aggregate

Calculate server-side column statistics (sum, mean, median, min, max, count, std, var, nunique) with grouping, filters, and top-N. Returns per-group values and Excel formulas to avoid manual errors.

Instructions

服务端聚合:sum / mean / median / min / max / count / std / var / nunique。

关键:聚合在服务端算好,只回传"每组一个数字"。 不要让模型自己遍历数据求和 —— 大数相加模型极易算错。

参数:

  • column:要聚合的列

  • op:聚合运算(默认 sum)

  • group_by:分组列(可多列),给出透视表式结果

  • filters:过滤条件(格式同 filter_count)

  • top_n:分组结果只返回前 N 组(按聚合值降序)

返回:聚合值或分组表,附 tsv(可直接粘回 Excel)与等价 Excel 公式。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opNosum
sheetNo
top_nNo
columnYes
filtersNo
group_byNo
file_pathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations provided, the description carries the full behavioral burden. It discloses that aggregation is computed server-side, only one number per group is returned, and the output includes a TSV and equivalent Excel formula. It also surfaces a key failure mode (model-side summation). It doesn't explicitly state non-mutation or error behavior, but the main operational traits are covered.

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 well-structured with a concise overview, a critical usage warning, a bulleted parameter list, and a return-value note. Every section earns its place, and the most important behavioral guidance is front-loaded.

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 7-parameter tool with no output schema, the description covers the return format, key parameters, and an important usage caveat. It lacks detail on file_path/sheet and edge cases, but the information needed to call the tool correctly is largely present.

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 description coverage is 0%, so the description compensates by explaining column, op (with default sum), group_by, filters format, and top_n ordering. It leaves file_path and sheet unexplained, though those are largely inferable from context. The parameter explanations add meaningful value beyond the bare schema.

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 defines the tool as server-side aggregation over a column, listing supported operations (sum/mean/median/etc.) and the output shape ('每组一个数字'). It doesn't explicitly name sibling alternatives like filter_count or create_pivot, but the operation list and grouped-result behavior make the purpose clear.

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 gives explicit when-to-use guidance: use server-side aggregation rather than having the model iterate and sum data, warning that large-number addition is error-prone. It also references filter_count for filter syntax, which helps the agent reuse known format. It doesn't fully enumerate when to choose this over sibling tools, but the core usage context is present.

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