Skip to main content
Glama
apetta

Vibe Math MCP

by apetta

Pivot Table

pivot_table
Read-onlyIdempotent

Summarize tabular data by creating pivot tables: choose row and column indices, select a value column, and apply aggregation (sum, mean, count, min, max) to reveal patterns and relationships.

Instructions

Create pivot tables from tabular data using Polars.

Like Excel pivot tables: reshape data with row/column dimensions and aggregated values.

Example:

SALES BY REGION AND PRODUCT: data=[ {"region":"North","product":"A","sales":100}, {"region":"North","product":"B","sales":150}, {"region":"South","product":"A","sales":80}, {"region":"South","product":"B","sales":120} ], index="region", columns="product", values="sales", aggfunc="sum" Result: product | A | B --------|------|------ North | 100 | 150 South | 80 | 120

COUNT AGGREGATION: Same data with aggfunc="count" Result: Count of entries per region-product combination

AVERAGE SCORES: data=[{"dept":"Sales","role":"Manager","score":85}, ...] index="dept", columns="role", values="score", aggfunc="mean" Result: Average scores by department and role

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextNoOptional annotation to label this calculation (e.g., 'Bond A PV', 'Q2 revenue'). Appears in results for easy identification.
output_modeNoOutput format: full (default), compact, minimal, value, or final. See batch_execute tool for details.full
dataYesList of row dictionaries
indexYesColumn name for row index
columnsYesColumn name for pivot columns
valuesYesColumn name to aggregate
aggfuncNoAggregation functionsum

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Annotations already declare readOnlyHint and idempotentHint; description adds meaningful behavioral context by explaining the operation (Polars-based, Excel-like), providing example outputs, and detailing parameter effects like aggregation functions. No contradictions with annotations.

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?

Description is well-structured with a clear opening, comparison, and multiple labeled examples. It is slightly long but each example serves a distinct purpose; no wasted sentences.

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?

Given the tool's moderate complexity and the presence of an output schema (as noted in context signals), the description fully explains the tool's behavior with diverse examples covering common aggfuncs. No gaps remain for typical use cases.

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 coverage is 100% with descriptions for all parameters, so baseline is 3. Description adds value through concrete examples that illustrate parameter relationships (e.g., index, columns, values, aggfunc), enhancing understanding beyond schema alone.

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?

Description clearly states 'Create pivot tables from tabular data using Polars' and analogizes to Excel pivot tables. Examples demonstrate specific verb+resource (pivot tables) and distinguish from sibling tools like array_aggregate or statistics, which serve different purposes.

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?

Description provides clear usage context with examples for sum, count, and mean aggregations, implying when to use (reshaping with aggregation). However, it does not explicitly state when not to use or compare to alternatives, leaving slight ambiguity.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/apetta/vibe-math-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server