Skip to main content
Glama

aggregate

Read-onlyIdempotent

Group and summarize spreadsheet data with pivot-style metrics, filters, and sorting. Aggregate xlsx, csv, parquet, or json files into grouped tables or saved report files.

Instructions

Group-by summaries and pivot tables (like Excel PivotTables) over xlsx/csv/parquet/json.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "source": "<source>",
      "metrics": "<metrics>"
    },
    "name": "aggregate"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax rows to return (default from server config, usually 100).
sheetNoSheet name (or 0-based index). Default: first sheet.
whereNoSQL filter applied before grouping.
formatNojson = rows as arrays, records = list of objects, markdown = a table.json
havingNoSQL filter on groups, e.g. 'sum_amount > 1000'.
outputNoSave the FULL result to this file (.xlsx/.csv/.parquet/.json/.md) instead of returning rows.
sourceYesData file; for a specific sheet use 'book.xlsx#Sheet1' or the sheet parameter.
metricsYese.g. ['amount:sum', 'amount:avg', 'customer:count_distinct', 'count'] or SQL like 'sum(qty*price) AS revenue'. Funcs: sum avg min max count count_distinct median std var first last.
group_byNoColumns to group by.
order_byNoSort results.
pivot_onNoMake a pivot table: one output column per distinct value of this column.
output_sheetNoWhen output is an existing .xlsx: write into this sheet (replaced if it exists), keeping other sheets.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is supplied. However, the schema exposes an 'output' and 'output_sheet' capability that persists results to disk (overwriting an existing sheet), and the description says nothing about this side effect, about the row-limit default, or about what happens to existing sheets — the annotation and the write capability sit in unexplained tension.

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?

A single tight sentence with zero filler and the core capability front-loaded. It is efficient but arguably under-sized for a 12-parameter tool with pivot and file-output behavior.

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

Completeness2/5

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

For a 12-parameter tool that can both compute pivots and persist results to xlsx/csv/parquet, one sentence is thin. There is no output schema, so the description should at least sketch the shape of a pivot result or note that output suppresses returned rows, and it does neither.

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 100% and every one of the 12 parameters carries its own description, so the baseline is 3. The description adds no meaning beyond the schema — it does not, for example, explain the metric string grammar or the where/having distinction, both of which are already covered in the 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?

States a specific verb+resource ('Group-by summaries and pivot tables') and names the supported input formats (xlsx/csv/parquet/json), plus an Excel PivotTable analogy that makes the output shape concrete. It does not distinguish itself from adjacent siblings such as query, describe, or profile, so an agent cannot tell from the description alone which one to reach for.

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?

There is no when-to-use or when-not-to-use guidance. The presence of siblings like query, describe, and profile — which could plausibly overlap with grouped summarization — is never addressed, nor are prerequisites such as needing a source file or a valid metrics string.

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