Skip to main content
Glama

group_by

Aggregate rows by key columns with sum, count, average, min, max, or distinct count. Appends a Table.Group step to the Power Query M code for summarization.

Instructions

Power Query Group By: collapse rows to one per key-column combination with aggregates. Appends Table.Group to the table's M query. keyColumns is comma-separated. aggregations is comma-separated as name:op[:column], e.g. "Total:Sum:Amount,Lines:Count,Distinct Customers:CountDistinct:CustomerId". op = Sum | Count | Average | Min | Max | CountDistinct | All (column required except for Count/All).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYes
sessionIdYes
keyColumnsYesthe grouping key columns, comma-separated
aggregationsYesaggregations as name:op[:column], comma-separated
partitionNameNopartition name (optional; defaults to the first partition)
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool 'Appends Table.Group to the table's M query,' indicating model mutation. It also details aggregation operation constraints (e.g., column required except for Count/All). However, it does not mention error conditions or reversibility.

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?

The description is a single dense paragraph but well-organized: purpose, M query effect, parameter formats, example, and op list. Every sentence contributes value, though it could be slightly more scannable with line breaks.

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?

Given the tool's complexity and the absence of an output schema, the description adequately covers the core behavior and parameter syntax. It does not explain the function of table/sessionId, but these are common across sibling tools and likely self-evident. The M query modification note adds important context.

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?

The description adds significant meaning beyond the schema, especially for the 'aggregations' parameter, specifying the format 'name:op[:column]', an example, and the list of allowed ops. It also clarifies that keyColumns is comma-separated, matching the schema. It does not explain table/sessionId, but those are likely standard and not the source of complexity.

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?

The description clearly states the tool's purpose: 'collapse rows to one per key-column combination with aggregates' and 'Appends Table.Group to the table's M query.' This specific verb+resource phrasing distinguishes it from sibling tools like fuzzy_group or group_keep_all_columns.

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

Usage Guidelines3/5

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

The description implies usage for grouping with aggregates and gives a concrete example, but it does not explicitly state when to use this tool versus alternatives such as fuzzy_group or group_keep_all_columns. No when-not-to-use guidance is provided.

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/cyphonica/powerbi-pbix-mcp'

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