Skip to main content
Glama
snahrup

Microsoft Fabric MCP Server

by snahrup

execute_dax_query

Execute DAX queries on Power BI datasets to analyze data and retrieve insights through the Microsoft Fabric MCP Server.

Instructions

Execute a DAX query on a Power BI dataset

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
datasetIdYesThe ID of the dataset
queryYesThe DAX query to execute

Implementation Reference

  • The implementation of the executeDaxQuery method in the PowerBIClient class.
    async executeDaxQuery(datasetId: string, query: string): Promise<DaxQueryResult> {
      try {
        const response = await this.apiClient.post(`/datasets/${datasetId}/executeQueries`, {
          queries: [
            {
              query: query
            }
          ]
        });
        return response.data;
      } catch (error) {
        console.error('Error executing DAX query:', error);
        throw error;
      }
    }
  • src/index.ts:172-183 (registration)
    The MCP tool handler for 'execute_dax_query' in src/index.ts.
    case 'execute_dax_query': {
      const { datasetId, query } = ExecuteDaxQuerySchema.parse(args);
      const result = await powerBIClient.executeDaxQuery(datasetId, query);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • The Zod schema validation for the 'execute_dax_query' tool arguments.
    const ExecuteDaxQuerySchema = z.object({
      datasetId: z.string().describe('The ID of the dataset'),
      query: z.string().describe('The DAX query to execute'),
    });
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action but lacks details on permissions required, rate limits, whether the query is read-only or modifies data, error handling, or expected response format. This is inadequate for a tool that executes queries.

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 a single, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly.

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

Completeness2/5

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

Given the complexity of executing queries and lack of annotations or output schema, the description is incomplete. It doesn't cover behavioral aspects like safety, performance, or return values, leaving significant gaps for an AI agent to understand how to use this tool effectively.

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 100%, so the input schema fully documents both parameters ('datasetId' and 'query'). The description adds no additional meaning beyond what's in the schema, such as query syntax examples or dataset ID sourcing. Baseline 3 is appropriate as the schema handles parameter documentation.

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?

The description clearly states the action ('Execute a DAX query') and target resource ('on a Power BI dataset'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'refresh_dataset' or 'get_powerbi_datasets' in terms of specific use cases or scope.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing a dataset ID from 'get_powerbi_datasets'), appropriate contexts, or limitations compared to siblings like 'create_notebook' for data analysis.

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/snahrup/microsoft-fabric-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server