Skip to main content
Glama
snahrup

Microsoft Fabric MCP Server

by snahrup

get_powerbi_datasets

Retrieve all Power BI datasets from a Microsoft Fabric workspace to access and manage data models for analysis and reporting.

Instructions

Get all Power BI datasets in the workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual implementation of fetching datasets from Power BI.
    async getDatasets(): Promise<Dataset[]> {
      try {
        // Use workspace-specific endpoint if workspace ID is available
        const workspaceId = process.env.POWERBI_WORKSPACE_ID;
        const endpoint = workspaceId 
          ? `/groups/${workspaceId}/datasets`
          : '/datasets';
        
        const response = await this.apiClient.get(endpoint);
        return response.data.value;
      } catch (error) {
        console.error('Error fetching datasets:', error);
        throw error;
      }
    }
  • src/index.ts:58-64 (registration)
    Tool registration for get_powerbi_datasets.
      name: 'get_powerbi_datasets',
      description: 'Get all Power BI datasets in the workspace',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • The handler in index.ts that maps the MCP request to the powerBIClient implementation.
    case 'get_powerbi_datasets': {
      const datasets = await powerBIClient.getDatasets();
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(datasets, null, 2),
          },
        ],
      };
    }

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