Skip to main content
Glama

run_dax_query

Execute arbitrary DAX queries against an open Power BI file to handle ad hoc aggregations, filtering, top-N, distinct lists, and candidate measure testing that higher-level tools miss.

Instructions

Run an arbitrary DAX query (an EVALUATE statement, optionally with DEFINE MEASURE/VAR blocks above it) against an open Power BI file. Use this for anything the higher-level tools (list_tables, list_measures, etc.) don't cover -- ad hoc aggregations, filtering, top-N, DISTINCT lists, testing a candidate measure definition, and so on.

Returns {"rows": [...], "row_count": n, "truncated": bool}. Results are capped at max_rows; when truncated is true there were MORE rows than were returned, so never draw a "this is everything" conclusion from a truncated result -- aggregate in DAX (or raise max_rows) instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instanceYes
max_rowsNo
dax_queryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and does well: it specifies the return shape, row cap behavior, and the truncation warning. It does not explicitly state whether the query is read-only or what permissions are required, which is a minor remaining gap for an arbitrary query tool.

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?

Front-loads the core purpose and usage, then adds return shape and truncation warning without filler. Every sentence contributes operational guidance.

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 simple three-parameter schema and available output schema, the description is complete enough: it explains the query format, row limit behavior, and result shape. The only minor omission is explicit instance identifier semantics, which is not enough to reduce the score.

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 description coverage is 0%, so the description must compensate. It adds useful meaning for dax_query by specifying EVALUATE and optional DEFINE MEASURE/VAR blocks, and for max_rows by explaining truncation behavior, though instance semantics remain largely implied by 'open Power BI file.'

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?

States a specific verb and resource: run an arbitrary DAX query against an open Power BI file. It also distinguishes itself from higher-level sibling tools like list_tables and list_measures by positioning itself as the fallback for ad hoc queries.

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 says to use this for anything the higher-level tools do not cover and gives concrete examples such as ad hoc aggregations, filtering, top-N, DISTINCT lists, and testing candidate measure definitions. The when-to-use guidance is clear and actionable.

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