Skip to main content
Glama

aggregate

Groups rows in an Excel sheet and computes sum, count, mean, min, or max per group, with row and group filters.

Instructions

Fetches a sheet LIVE and runs a grouped aggregation. Operations: sum, count, mean, min, max. group_by is one column name or a list of them. conditions filters rows before aggregating (same grammar as filter_sheet, including the object form). having filters the AGGREGATED rows afterwards, e.g. having={"Revenue": ">1000"} keeps only groups whose aggregate exceeds 1000. SINGLE FILE ONLY. For totals across multiple files you MUST use cross_file_aggregate instead — never use this tool and then manually add results across files. Get column names from get_workspace_graph first. Returns rows plus a truncated flag. If conditions matched zero rows, zero_match_diagnostics shows what each condition matched alone and the values actually present — correct the condition and retry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sheetYes
havingNo
group_byYes
file_nameYes
operationYes
value_colYes
conditionsNo
folder_pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Despite no annotations, the description discloses key behavioral traits: live data fetch, output includes a 'truncated flag', and zero_match_diagnostics behavior when no rows match. It also explains condition grammar and having filter semantics with an example, providing substantial context beyond the schema.

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 dense but well-structured with line breaks, and each sentence adds necessary information (operations, parameters, single-file constraint, diagnostics). It is slightly long but avoids redundancy and earns its length.

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

Completeness5/5

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

Given the complexity (8 params, grouped aggregation), the description covers essential context: multi-file exclusion, column names source, condition/having grammar, return flags, and error diagnostics. An output schema exists, so return details need not be repeated. Folder_path is the only minor omission, but optional and less critical.

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 carries the burden. It explains group_by (column name or list), conditions (filter_sheet grammar), having (post-aggregation filter with example), and lists operations. However, folder_path and file_name/sheet are not explicitly described, leaving minor gaps for those parameters.

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?

The description clearly states the tool's core action: 'Fetches a sheet LIVE and runs a grouped aggregation' and lists supported operations. It also distinguishes itself from siblings by explicitly limiting to a single file and pointing to cross_file_aggregate for multi-file operations.

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

Usage Guidelines5/5

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

Provides explicit when-to-use and when-not-to-use guidance: 'SINGLE FILE ONLY' and 'For totals across multiple files you MUST use cross_file_aggregate instead'. It also references filter_sheet grammar for condition syntax and advises fetching column names from get_workspace_graph first.

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/Karunya-Muddana/ExcelMCP'

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