Skip to main content
Glama
ppiotis
by ppiotis

Pivot table

pivot_table
Read-onlyIdempotent

Cross-tabulate CSV data by setting one column as rows and another as columns, then aggregate a value column with count, sum, mean, min, max, or median.

Instructions

Cross-tabulate: one column as rows, another as columns, aggregating a value column. Max 50 output columns.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aggNosum
fileYesCSV path relative to the allowed directory (CSV_INSIGHTS_DIR), e.g. 'sales/2026-q3.csv'
rowsYesColumn whose values become rows
valueNoColumn to aggregate (omit for counts)
whereNoRow filters, all must match (AND)
columnsYesColumn whose values become columns

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?

Annotations already declare readOnlyHint/idempotentHint/destructiveHint=false, so the safety profile is covered structurally. The description adds one genuine behavioral fact not present in structured data — the 50 output-column cap — but says nothing about behavior when the cap is exceeded, how empty results are shaped, or error conditions.

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 that defines the operation, its three roles, and the hard output limit in roughly twenty words. Terse but every clause carries information; no padding or repetition.

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?

With nodescription of return values required (no output schema) and a dense schema plus safety annotations, the description supplies the one piece of missing operational context, the 50-column output limit. What remains missing is guidance on the agg default's interaction with 'value' and the AND semantics of 'where', though the schema covers the latter.

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 83%, so the schema already documents file, rows, columns, value, and where. The description's mapping of columns to row/column/value roles largely restates the schema, so the baseline 3 applies with no meaningful added 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?

States a specific verb (cross-tabulate) and the three input roles (rows column, columns column, value column), which is precise enough that an agent can distinguish it from a plain aggregation tool. However it never distinguishes itself from the sibling group_by, which is the closest alternative.

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?

The description defines what a pivot is but gives no when-to-use, when-not-to-use, or alternative routing. With 'group_by' in the sibling list, an agent has no stated basis for choosing pivot_table over a one-dimensional grouping, which is the primary selection risk here.

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