Skip to main content
Glama

analyze_folding_risk

Estimate query folding risk per Power BI query by identifying SQL pushdown steps, the first step that stops folding, late row filters, Table.Buffer, and cross-source merges for M code review.

Instructions

Static estimate of query folding per query: which steps normally push down to SQL, the first step that stops folding, row filters that run locally AFTER folding ended (the source sent every row first), Table.Buffer, and merges across different sources (joined locally). SharePoint/file sources never fold. It is an estimate from M text, not proof: confirm with 'View Native Query', and use read_mashup_traces for the engine's own folding-failure reports.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instanceYes
include_stepsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full load and does it well: it discloses that results are a static heuristic from M text rather than proof, names the source types that never fold, and flags a surprising failure mode (row filters running locally after folding ends, meaning the source sent every row). It stops short of stating read-only/permission characteristics or cost, which is the only remaining gap.

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?

One dense paragraph, front-loaded with the core purpose, then findings, then caveats and alternatives. Nearly every clause carries information; it is long but not padded, though it could be broken into a purpose sentence plus a limitations sentence for scannability.

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?

An output schema exists, so return values needn't be spelled out, and the description covers the interpretive framing an agent needs. The missing piece is parameter documentation: for a 2-param tool with zero schema coverage, the description leaves both inputs undefined, which is enough of a hole to keep this from being complete.

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

Parameters2/5

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

Schema description coverage is 0% for both parameters, and the description never mentions 'instance' or 'include_steps'. The agent must infer from 'per query' that instance identifies the query, and has no guidance at all on what include_steps toggles or when to enable it — a real gap for a tool whose output verbosity depends on that flag.

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?

Opens with a precise verb+resource ('Static estimate of query folding per query') and then enumerates exactly which findings it produces: foldable steps, the first non-folding step, post-fold local row filters, Table.Buffer, and cross-source merges. That level of specificity distinguishes it from siblings like diagnose_power_query or find_query_diagnostics without needing their schemas.

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

Usage Guidelines5/5

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

Explicitly routes the agent elsewhere: confirm results with 'View Native Query' and use read_mashup_traces for the engine's own folding-failure reports. It also states a scope rule (SharePoint/file sources never fold), so the agent knows when this tool's output is meaningful versus when a different tool is the right call.

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