get_workspaces
Retrieve all Microsoft Fabric and Power BI workspaces to view available data environments for analysis and management.
Instructions
Get all Fabric/Power BI workspaces
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:198-208 (handler)The handler for 'get_workspaces' tool in the MCP server, which calls powerBIClient.getWorkspaces().
case 'get_workspaces': { const workspaces = await powerBIClient.getWorkspaces(); return { content: [ { type: 'text', text: JSON.stringify(workspaces, null, 2), }, ], }; } - src/powerbi-client.ts:92-100 (handler)The actual implementation of fetching workspaces from the Power BI API.
async getWorkspaces(): Promise<any[]> { try { const response = await this.apiClient.get('/groups'); return response.data.value; } catch (error) { console.error('Error fetching workspaces:', error); throw error; } } - src/index.ts:96-103 (registration)Tool registration for 'get_workspaces'.
{ name: 'get_workspaces', description: 'Get all Fabric/Power BI workspaces', inputSchema: { type: 'object', properties: {}, }, },