Skip to main content
Glama

execute_dax_query

Execute DAX queries against Power BI/Fabric datasets to inspect business data, measure outputs, and test Row-Level Security by simulating user access.

Instructions

Execute a DAX query against a published Power BI semantic model / Fabric dataset.

Use this tool when the user asks to:

  • Run, evaluate, or test a DAX query against a live dataset in Power BI or Fabric.

  • Inspect actual business data, measure outputs, KPI calculations, or table rows.

  • Verify Row-Level Security (RLS) filters by simulating a specific user principal name.

Args: workspace_id: Fabric / Power BI workspace ID (UUID). dataset_id: Published semantic model / dataset ID (UUID). dax_query: The DAX query expression (e.g. "EVALUATE TOPN(10, 'Sales')" or "EVALUATE ROW("Total", [Total Sales])"). impersonated_user_name: Optional User Principal Name (UPN) to test RLS rules as that user. auth_mode: "interactive" (default, browser login) or "service_principal". tenant_id: Azure AD tenant ID (required for service_principal). client_id: Azure AD client ID (for service_principal). client_secret: Azure AD client secret (for service_principal). fabric_client: Optional injected FabricClient instance (for testing).

Returns: Dict containing query execution results with tabular rows, columns, and execution metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
auth_modeNointeractive
client_idNo
dax_queryYes
tenant_idNo
dataset_idYes
workspace_idYes
client_secretNo
fabric_clientNo
impersonated_user_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.11.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses the auth modes, default behavior (interactive browser login), and that results are wrapped in a dict. But it lacks key behavioral details: whether the query is read-only, whether impersonation can mutate state, rate limits/timeouts, or error behavior — important for a tool that runs arbitrary DAX.

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?

Front-loaded with the core purpose, then structured into use cases, Args, and Returns sections. The parameter list is verbose for the client_secret/tenant/client trio, but the structure is clear and scan-friendly.

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?

Covers the two auth flows, the optional RLS impersonation path, the required parameters, and a brief return description, which is sufficient given a rich input schema with 9 parameters. The absence of documented error/timeout behavior and lack of differentiation from run_dax_regression are the main gaps.

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, and it does list every parameter with semantic detail: workspace_id/dataset_id are UUIDs, dax_query includes example expressions, auth_mode enum values, and tenant/client fields for service principals. Only missing: return-shape details per param and whether fabric_client is intended for production use.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (Execute) and resource (DAX query against a published Power BI semantic model / Fabric dataset). The use-case bullets make the domain clear. However, it doesn't explicitly distinguish from the sibling 'run_dax_regression', which also involves DAX execution — so the differentiation is partial.

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?

Provides explicit when-to-use bullets: run/evaluate/test DAX, inspect business data, verify RLS. But no when-not-to-use or named alternatives (e.g. run_dax_regression for regression suites) are given, and the RLS bullet overlaps with sibling 'setup_rls_and_roles' without clarifying the difference.

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