Skip to main content
Glama

create_pivot_table

Creates a pivot table from source data and adds aggregated results to a new sheet.

Instructions

Create a pivot table from source data. Creates a new sheet with the aggregated results.

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": {
      "workbookId": "<workbookId>",
      "sourceSheet": "<sourceSheet>",
      "sourceRange": "<sourceRange>",
      "rowFields": "<rowFields>",
      "dataFields": "<dataFields>"
    },
    "name": "create_pivot_table"
  }
}

Input Schema

NameRequiredDescriptionDefault
rowFieldsYesColumn headers to use as row grouping fields
dataFieldsYesFields to aggregate with their aggregation functions
workbookIdYesThe workbook ID
sourceRangeYesRange of source data including headers (e.g., 'A1:D100')
sourceSheetYesSheet containing source data (name or index)
destinationSheetNoName for the pivot table sheet (optional, auto-generated if not provided)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses the key side effect — a new sheet is created — which is the most important behavioral fact for a mutation tool. However, it omits whether the destinationSheet name collision overwrites or errors, whether changes persist to disk, and what the caller receives back.

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?

Two short, front-loaded sentences with essentially no waste. The second sentence is slightly redundant with 'Create a pivot table' but earns its place by disclosing the new-sheet side effect.

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 a 6-parameter creation tool with no annotations and no output schema, the description covers the core action but leaves gaps: the return value (new sheet name/id?) and the destinationSheet collision behavior are unstated. Adequate but not complete for a mutation tool with zero annotation coverage.

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 the schema already documents rowFields, dataFields, sourceRange, sourceSheet, and destinationSheet. The description adds no additional parameter semantics (e.g., how rowFields interact with dataFields), so the baseline of 3 applies.

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 states a specific verb and resource ('Create a pivot table from source data') and adds the output artifact ('a new sheet with the aggregated results'). It is clearly distinct from siblings like create_chart or create_sheet, though it does not explicitly contrast itself with them.

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?

No when-to-use guidance is given: nothing about prerequisites (e.g., whether the workbook must be open), when to prefer this over create_chart or manual aggregation, or when not to use it. The agent must infer all selection context.

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