Skip to main content
Glama
Power BI MCP Server

Power BI MCP Server

by mbmccormick

execute_dax_query

Run DAX EVALUATE queries against a Power BI dataset to retrieve data such as aggregated sales totals or top-ranked products, returning the query results for analysis and reporting.

Instructions

Execute a DAX query against a Power BI dataset (semantic model) and return the results.

Use this tool to query data from Power BI semantic models using DAX (Data Analysis Expressions). The query must be a valid EVALUATE statement.

Examples:

  • EVALUATE SUMMARIZECOLUMNS('Date'[Year], "Total Sales", SUM('Sales'[Amount]))

  • EVALUATE TOPN(10, 'Products', 'Products'[Revenue], DESC)

  • EVALUATE ROW("Total", CALCULATE(SUM('Sales'[Amount])))

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "datasetId": "<datasetId>",
      "query": "<query>"
    },
    "name": "execute_dax_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesThe DAX query to execute. Must be a valid EVALUATE statement.
datasetIdYesThe dataset (semantic model) ID to query.
workspaceIdNoThe workspace (group) ID. Omit for 'My Workspace'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden; it does disclose the key constraint (EVALUATE-only syntax) and that results are returned, which is more than nothing. It is silent on the read-only nature of the operation, permissions/auth requirements, row limits, timeouts, and what happens on an invalid query, all of which matter for a query-execution tool with zero annotation coverage.

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?

Purpose is front-loaded in the opening sentence, followed by usage and examples, with no filler. The three examples are slightly redundant in form but each demonstrates a different DAX pattern, so they roughly earn their space.

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?

For a tool with no annotations and no output schema, the definition explains input format well but leaves the response shape (columns/rows, truncation) and failure modes unspecified. Those are the main remaining gaps an agent would want filled before invoking it.

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%, so the baseline is 3, but the three worked DAX examples add genuine meaning about the expected query format that the schema alone ('Must be a valid EVALUATE statement') does not convey. It still adds nothing about datasetId/workspaceId semantics, which is fine since the schema documents those.

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 first sentence gives a specific verb and resource ('Execute a DAX query against a Power BI dataset (semantic model)') and states the return behavior. That combination — arbitrary DAX execution against a semantic model — is unmistakably different from the metadata-oriented siblings (list_datasets, get_tables, get_refresh_history), so an agent can pick it without opening any schema.

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?

It says to use this tool to 'query data from Power BI semantic models using DAX' and imposes a hard constraint that the query be a valid EVALUATE statement. However, it gives no prerequisites (e.g., that datasetId normally comes from list_datasets/discover_model), no exclusions, and no guidance on when to prefer a simpler metadata sibling over a custom query.

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