Skip to main content
Glama

Create pivot table

create_pivot_table

Add an Excel PivotTable that summarizes a data block by row, column, filter, and value fields, returning its name and output cells.

Instructions

Add a PivotTable that summarizes a block of data. Returns its name and cells.

Excel can refresh it; its figures (with subtotals and Grand Totals) are also written into the cells. A field can be used only once among row, column and filter fields.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
atYesTop-left cell; the area must be empty.
nameNoPivotTable name. Default: PivotTableN.
pathYes
sheetYesSheet for the PivotTable.
layoutNoRow label layout.tabular
sourceYesHeader row of unique text labels, then records, e.g. 'Data!A1:E200' (no sheet: `sheet`). Columns may mix types; formulas count by their results.
subtotalsNoOf outer fields.
values_inNoWhere several value fields go.columns
row_fieldsYesHeaders to group by down the side, outermost first.
value_fieldsYesHeaders to summarize.
column_fieldsNoHeaders across the top, outermost first.
filter_fieldsNoHeaders as page filters.
field_settingsNoItems to show, sort order and grouping for row, column or filter headers.
calculated_fieldsNoUsable in value_fields.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.1
    • changedInput schema / properties / source / description
      Previous value: -"Header row of unique text labels, then records, e.g. 'Data!A1:E200' (no sheet: `sheet`). Each column holds only text, numbers or dates (blanks fine), not formulas."New value: +"Header row of unique text labels, then records, e.g. 'Data!A1:E200' (no sheet: `sheet`). Columns may mix types; formulas count by their results."
  2. Addedv2.0.0
  3. Removedv1.1.1
  4. First observedv1.0.0

TDQS

A3.6/5.0
Behavior4/5

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

Beyond the provided annotations, the description discloses real behavioral facts: it returns the table's name and cells, the figures (with subtotals and Grand Totals) are written into the cells as static values while Excel can still refresh the pivot, and the field-uniqueness rule that will cause an error if violated. It does not mention permission requirements or the empty-area precondition, but the added side-effect detail is genuinely useful.

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?

Three short sentences, front-loaded with the purpose, then return/side-effect behavior, then the constraint. No filler, though the field-uniqueness rule could be tightened slightly.

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

Completeness4/5

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

For a complex 14-parameter tool with no output schema, the description covers the essential missing pieces: what is produced (name and cells), what side effects land in the sheet, and a key validation constraint. Given 93% schema coverage, remaining gaps (prerequisites, permissions) are minor.

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 93%, so the schema already documents nearly every parameter and the baseline is 3. The description adds a cross-parameter constraint (each field may appear only once across row, column and filter fields) that is not encoded anywhere in the schema, which is exactly the kind of semantics that earns a bump.

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 and resource ('Add a PivotTable') plus scope ('summarizes a block of data') and even the return value, so it is clearly distinguishable from the sibling delete_pivot_table. It does not explicitly name or contrast any sibling, which is the only thing keeping it from a 5.

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 guidance and no routing to alternatives, even though siblings like set_table and create_chart could plausibly overlap for summarizing data. The only constraint offered ('a field can be used only once among row, column and filter fields') is a configuration rule, not usage guidance.

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