Skip to main content
Glama

group_aggregate

Group data by categories and compute metrics like mean, sum, count, median, or min/max. Use to compare segment performance, e.g., average revenue by city.

Instructions

GroupBy aggregation. Functions: mean, sum, count, min, max, median, std. For segmented analysis: understanding how metrics differ across groups. Useful for business questions like 'average revenue by city'. Example: group_aggregate(group_by=["City"], agg_column="Revenue", agg_func="mean")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
df_nameNo
agg_funcNomean
group_byYes
agg_columnYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
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. It states the core behavior (grouping and aggregating) and lists supported functions, which gives a basic understanding. However, it does not disclose edge-case behavior (e.g., handling of missing values, non-numeric columns, multiple group-by columns) or what the exact return structure is, leaving some behavioral ambiguity.

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 compact and well-organized: a clear definition, supported functions, usage context, and a concrete example. Every sentence adds value and the example is highly illustrative without being verbose.

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?

Given that an output schema exists (so return values need not be described) and the tool is relatively simple, the description covers the purpose, use case, and example adequately. It is slightly incomplete regarding df_name and possible variations, but overall it is sufficiently complete for a 4-parameter tool.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate. The example clarifies group_by, agg_column, and agg_func semantics well, and the function list adds meaning to agg_func. However, df_name is not mentioned at all, and there is no explanation of how the target dataframe is selected, which is a notable gap given the low schema coverage.

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 a 'GroupBy aggregation' with a specific list of functions (mean, sum, count, min, max, median, std) and includes a concrete example. It is specific about the verb and resource, but it does not explicitly distinguish this from the closely related sibling 'group_aggregate_multi' or other aggregation tools like 'describe_by_group'.

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?

The description provides clear use-case context: 'For segmented analysis: understanding how metrics differ across groups' and gives a business example. However, it does not mention when not to use this tool or explicitly point to alternatives, so it stops short of a 5.

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/AstyanM/mcp-data-science'

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