Skip to main content
Glama

running_total_m

Add a running total to Power BI tables, ordered by a column and optionally resetting per group, using a fast single-pass accumulation instead of slow row-by-row recalculation.

Instructions

Add a FAST running total of valueColumn ordered by orderColumn, optionally restarting within each groupColumn. Uses List.Buffer + a single accumulation pass (O(n)) rather than a per-row re-scan (O(n^2)). Appends sort + index + running-total steps to the table's M query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYes
sessionIdYes
groupColumnNothe partition column to reset within (optional)
orderColumnYesthe column that orders the rows
valueColumnYesthe value column to accumulate
partitionNameNopartition name (optional; defaults to the first partition)
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the algorithmic approach and that it 'Appends sort + index + running-total steps to the table's M query', which indicates a mutation of the query. However, it does not mention reversibility, required permissions, error conditions, or what happens to existing query steps, leaving gaps in the safety profile.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences that are front-loaded with the core purpose, then provide performance and implementation details. Every word earns its place, and it is neither verbose nor under-specified. This is an exemplary concise structure.

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

Completeness3/5

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

Given the moderate complexity (6 parameters, no output schema, no annotations), the description gives a good overview and key behavioral details (appending to M query, O(n) performance). However, it lacks information about prerequisites (e.g., numeric valueColumn), error handling, return values, or the impact on the existing query, making it only partially complete for fully informed use.

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 67%, and the tool description largely paraphrases the schema: 'of valueColumn ordered by orderColumn' mirrors the schema fields, and 'restarting within each groupColumn' reiterates the groupColumn description. It does not add new meaning beyond what the schema already provides, and it omits any explanation of partitionName or the standard sessionId/table parameters.

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 opens with a specific verb+resource: 'Add a FAST running total of valueColumn ordered by orderColumn, optionally restarting within each groupColumn.' This clearly states the function, the columns involved, and the optional grouping behavior. The name running_total_m and the emphasis on 'FAST' and 'M query' distinguish it from the similar sibling add_running_total.

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?

The description gives clear usage context by explaining the performance advantage: 'Uses List.Buffer + a single accumulation pass (O(n)) rather than a per-row re-scan (O(n^2)).' This signals when to prefer this tool for large tables. However, it does not explicitly name alternative tools or state when not to use it, so it falls short of a 5.

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