Skip to main content
Glama

files_set_pivot_table

Creates or reconfigures a PivotTable: a live cross-tabulation that groups source rows by fields and aggregates values per group; it recomputes when the source changes and exports to Excel as a real PivotTable. action='create' needs source (an A1 range whose first row is headers, e.g. 'A1:E500', or a table name) and at least one values entry; destination is 'new_sheet' (default) or a top-left cell like 'F1'. action='update' needs pivot_table_name (from files_context) and applies a merge: null leaves an area unchanged, an empty array clears it. Reference source columns by header name. rows/columns entries: {field, label?, sort? (ascending|descending|source_order), show_totals?, group_by? (seconds|minutes|hours|days|day_of_week|months|quarters|years), numeric_interval?}. values entries: {field, aggregation? (sum|count|count_numbers|distinct_count|average|median|max|min|product|stddev|stddevp|var|varp), name?, show_as? (percent_of_row_total|percent_of_column_total|percent_of_grand_total|running_total_in_rows|...|index)}. filters entries: {field, include?, exclude?}. Requires edit permission. Signature: files_set_pivot_table(file_uuid, action, pivot_table_name?, sheet?, source?, destination?, rows?, columns?, values?, filters?, layout?, values_layout?, row_grand_total?, column_grand_total?, subtotal_position?).

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_uuid": "<file_uuid>",
      "action": "<action>"
    },
    "name": "files_set_pivot_table"
  }
}

Input Schema

NameRequiredDescriptionDefault
rowsNoRow area fields, outermost first. Null keeps, [] clears.
sheetNoSheet the source data is on (defaults to the first sheet).
actionYes'create' or 'update'.
layoutNo'compact' (default), 'outline', or 'tabular'.
sourceNoCreate only. A1 range with headers in the first row, e.g. 'A1:E500', or a table name.
valuesNoAggregated value fields. Null keeps, [] clears; a report needs at least one.
columnsNoColumn area fields. Null keeps, [] clears.
filtersNoFilter fields restricting source rows. Null keeps, [] clears.
file_uuidYes
destinationNoCreate only. 'new_sheet' (default) or a top-left cell, e.g. 'F1'.
values_layoutNo'across_columns' (default) or 'down_rows'.
row_grand_totalNoGrand total column. Default true.
pivot_table_nameNoReport to update (from files_context). For create — optional name for the new report.
subtotal_positionNo'top' (default) or 'bottom'.
column_grand_totalNoGrand total row. Default true.

Output Schema

NameRequiredDescriptionDefault
createdNo
updatedNo
file_uuidYes
pivot_tableNo
sequence_numberYes
pivot_table_nameNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond annotations by disclosing merge behavior ('null leaves an area unchanged, an empty array clears it'), that the table recomputes when the source changes, and the edit-permission requirement. Annotations already cover safety hints (non-readOnly, non-destructive, non-idempotent), and the description adds meaningful operational context on top.

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?

Front-loads the purpose, then create/update requirements, then nested entry shapes, all dense and useful. The trailing 'Signature: ...' duplicates the input schema and could be dropped, a minor redundancy in an otherwise efficient definition.

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

Completeness5/5

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

For a 15-parameter tool with an output schema, the description covers both action paths, source/destination formats, nested entry schemas, merge semantics, and permission requirements. An agent has everything needed to invoke it correctly without opening the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Top-level schema coverage is 93%, but the nested rows/columns/values/filters items are bare 'type: object' in the schema. The description compensates by enumerating the nested entry shape (field, label, sort values, show_totals, group_by intervals, numeric_interval) and the values/filters entry fields, adding substantial semantics the schema does not provide.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Creates or reconfigures a PivotTable') and immediately defines what a PivotTable is: a live cross-tabulation that groups rows, aggregates values, recomputes on source change, and exports as a real Excel PivotTable. This clearly separates it from siblings like files_delete_pivot_table, files_add_chart, and files_convert_to_table.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly splits the two modes: action='create' requires source + at least one values entry, while action='update' needs pivot_table_name (from files_context) and applies merge semantics. It names prerequisites (edit permission) but does not explicitly route to sibling alternatives such as files_delete_pivot_table for removal, so it stops short of full alternative guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources