Skip to main content
Glama
xlsx-for-ai

xlsx-for-ai

by senoff

xlsx_aggregate

Read-onlyIdempotent

Group spreadsheet rows by selected columns and aggregate values with sum, mean, min, max, count, or distinct count to produce per-group summaries.

Instructions

Use this when you need to group and aggregate (sum/mean/min/max/count/count_distinct) values on a spreadsheet — reshape rows into per-group summaries.

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": {
      "file_path": "<file_path>",
      "group_by": "<group_by>",
      "aggs": "<aggs>"
    },
    "name": "xlsx_aggregate"
  }
}

Input Schema

NameRequiredDescriptionDefault
aggsYesAggregations: { column, func, as? }.
sortNoSort groups by the first aggregation: asc / desc / none (default none).
limitNoMax groups to return (default 1000).
sheetNoSheet name (default: first sheet).
group_byYesColumns to group by.
file_pathYesAbsolute path to the .xlsx file. Pass the path string AS-IS — do NOT read, open, or base64-encode the file; the client handles all file I/O. The base64 surface in this connector is OUTPUT-only (_meta.file_b64).
header_rowNoHeader row (1-based). 0 = treat row 1 as data, no header.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv4.3.1
    • addedInput schema / properties / aggs / description
      Added value: +"Aggregations: { column, func, as? }."
    • removedInput schema / properties / aggs / maxItems
      Removed value: -16
    • removedInput schema / properties / file_b64
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / file_path
      Added value: +{
      +  "description": "Absolute path to the .xlsx file. Pass the path string AS-IS — do NOT read, open, or base64-encode the file; the client handles all file I/O. The base64 surface in this connector is OUTPUT-only (_meta.file_b64).",
      +  "type": "string"
      +}
    • addedInput schema / properties / group_by / description
      Added value: +"Columns to group by."
    • removedInput schema / properties / group_by / maxItems
      Removed value: -6
    • addedInput schema / properties / header_row
      Added value: +{
      +  "description": "Header row (1-based). 0 = treat row 1 as data, no header.",
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "default": 1000,
      +  "description": "Max groups to return (default 1000).",
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • removedInput schema / properties / options
      Removed value: -{
      -  "properties": {
      -    "header_row": {
      -      "minimum": 0,
      -      "type": "integer"
      -    },
      -    "limit": {
      -      "maximum": 1000,
      -      "minimum": 1,
      -      "type": "integer"
      -    },
      -    "sheet": {
      -      "type": "string"
      -    },
      -    "sort": {
      -      "enum": [
      -        "asc",
      -        "desc",
      -        "none"
      -      ],
      -      "type": "string"
      -    }
      -  },
      -  "type": "object"
      -}
    • addedInput schema / properties / sheet
      Added value: +{
      +  "description": "Sheet name (default: first sheet).",
      +  "type": "string"
      +}
    • addedInput schema / properties / sort
      Added value: +{
      +  "description": "Sort groups by the first aggregation: asc / desc / none (default none).",
      +  "enum": [
      +    "asc",
      +    "desc",
      +    "none"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "aggs",
      -  "file_b64",
      -  "group_by"
      -]New value: +[
      +  "file_path",
      +  "group_by",
      +  "aggs"
      +]
  2. First observedv3.2.1

TDQS

B3.3/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=false, so safety is fully covered. The description adds nothing beyond that: it does not mention the default 1000-group cap, how sorting or grouping keys behave, null/missing-value handling, or what the summary rows look like — 'reshape rows into per-group summaries' is the only hint at output shape.

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?

A single sentence that front-loads the trigger and then the operation, with zero filler. Nothing is repeated or wasted.

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

Completeness3/5

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

With no output schema, the description is the only place a caller could learn the return shape, and it gives just 'per-group summaries' without stating whether output is a table, a file path, or an inline payload. The rich annotations and fully documented schema compensate for most of the gap, making this adequate but not complete.

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%, so all seven parameters including the aggs sub-object, sort, limit and header_row are already documented in the schema. The description only repeats the function enum, adding no syntax, defaults, or interaction rules (e.g. how sort relates to the first aggregation).

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?

Names a specific verb and resource ('group and aggregate ... values on a spreadsheet') and enumerates the supported functions (sum/mean/min/max/count/count_distinct), so the operation is unmistakable. It does not distinguish itself from plausible siblings such as xlsx_pivot or xlsx_filter, which is what keeps it out of the top band.

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 opener 'Use this when you need to group and aggregate' supplies a trigger, but it essentially restates the purpose rather than disambiguating. There is no guidance on when to prefer xlsx_pivot, xlsx_filter, or xlsx_describe, and no preconditions or exclusions are stated.

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