Skip to main content
Glama
xlsx-for-ai

xlsx-for-ai

by senoff

xlsx_pivot

Read-onlyIdempotent

Reshape a flat Excel table into a pivot-style 2D matrix, grouping rows by index and columns by optional fields with an aggregate value per cell.

Instructions

Use this when you need a pivot-table reshape — reshape a flat table into a 2D matrix of index × columns with an aggregated value per cell.

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>",
      "index": "<index>",
      "values": "<values>"
    },
    "name": "xlsx_pivot"
  }
}

Input Schema

NameRequiredDescriptionDefault
aggNoAggregation function (default sum).
indexYesRow-axis grouping columns.
sheetNoSheet name (default: first sheet).
valuesYesColumns to aggregate.
columnsNoColumn-axis grouping columns (optional).
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).
fill_valueNoValue (number or string) to use for missing index×column cells. Default empty string.
header_rowNoHeader row (1-based). 0 = treat row 1 as data, no header.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed14 schema fields changedv4.3.1
    • addedInput schema / properties / agg / description
      Added value: +"Aggregation function (default sum)."
    • addedInput schema / properties / columns / description
      Added value: +"Column-axis grouping columns (optional)."
    • removedInput schema / properties / columns / maxItems
      Removed value: -4
    • 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 / fill_value
      Added value: +{
      +  "description": "Value (number or string) to use for missing index×column cells. Default empty string.",
      +  "type": [
      +    "number",
      +    "string"
      +  ]
      +}
    • 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 / index / description
      Added value: +"Row-axis grouping columns."
    • removedInput schema / properties / index / maxItems
      Removed value: -4
    • removedInput schema / properties / options
      Removed value: -{
      -  "properties": {
      -    "fill_value": {},
      -    "header_row": {
      -      "minimum": 0,
      -      "type": "integer"
      -    },
      -    "sheet": {
      -      "type": "string"
      -    }
      -  },
      -  "type": "object"
      -}
    • addedInput schema / properties / sheet
      Added value: +{
      +  "description": "Sheet name (default: first sheet).",
      +  "type": "string"
      +}
    • addedInput schema / properties / values / description
      Added value: +"Columns to aggregate."
    • removedInput schema / properties / values / maxItems
      Removed value: -8
    • changedInput schema / required
      Previous value: -[
      -  "file_b64",
      -  "index",
      -  "values"
      -]New value: +[
      +  "file_path",
      +  "index",
      +  "values"
      +]
  2. First observedv3.2.1

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and closed-world scope, so the safety profile is covered and the bar is lower. The description contributes the output shape concept (a 2D matrix), which is useful behavioral context. It does not state what is actually returned (e.g., whether the matrix is written back to the workbook or returned inline), nor any limits on matrix size.

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 front-loaded sentence with the trigger condition first and the definition second — nothing extraneous. Minor redundancy in repeating 'reshape' twice in the same sentence, but it does not impede comprehension.

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?

For an 8-parameter transformation tool with no output schema, the description covers the core semantics but omits the return contract entirely — an agent cannot tell whether the pivot result is returned as data or persisted into the file. Parameter details are fully carried by the schema, so the gap is narrow but real.

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 every parameter including agg's enum, fill_value, header_row and the file_path I/O warning is already documented in structured fields. The description's phrase 'index × columns with an aggregated value per cell' does map the roles of index, columns, values and agg onto the conceptual model, adding modest meaning. That is baseline-level added value rather than new semantics.

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 names a specific operation ('pivot-table reshape') and defines it concretely as turning a flat table into a 2D index × columns matrix with an aggregated value per cell. That is far more than a restated name and lets an agent picture the transformation. It stops short of distinguishing this from near siblings like xlsx_pivot_tables (native pivot tables) or xlsx_aggregate, so it is clear but not sibling-differentiated.

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?

'Use this when you need a pivot-table reshape' gives a positive trigger condition, which is more than nothing. However, there are no exclusions or alternative routing — nothing tells the agent when to prefer xlsx_aggregate or xlsx_pivot_tables instead, despite those being obvious near-overlaps. Usage is implied rather than fully specified.

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