Skip to main content
Glama
snahrup

Microsoft Fabric MCP Server

by snahrup

upload_to_datawarehouse

Upload data arrays to Microsoft Fabric Data Warehouse tables for analysis and reporting.

Instructions

Upload data to a Fabric Data Warehouse

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceIdYesThe workspace ID
warehouseIdYesThe data warehouse ID
tableNameYesName of the table
dataYesArray of data rows to upload

Implementation Reference

  • The actual implementation of the tool logic that communicates with the API to upload data.
    async uploadToDataWarehouse(workspaceId: string, warehouseId: string, tableName: string, data: any[]): Promise<void> {
      try {
        // This would typically use the SQL endpoint or COPY INTO command
        const response = await this.apiClient.post(
          `/workspaces/${workspaceId}/datawarehouses/${warehouseId}/tables/${tableName}/rows`,
          { rows: data }
        );
        return response.data;
      } catch (error) {
        console.error('Error uploading to data warehouse:', error);
        throw error;
      }
    }
  • Zod schema defining the input validation for the upload_to_datawarehouse tool.
    const UploadToDataWarehouseSchema = z.object({
      workspaceId: z.string().describe('The workspace ID'),
      warehouseId: z.string().describe('The data warehouse ID'),
      tableName: z.string().describe('Name of the table'),
      data: z.array(z.any()).describe('Array of data rows to upload'),
    });
  • src/index.ts:126-150 (registration)
    MCP tool registration for upload_to_datawarehouse.
      name: 'upload_to_datawarehouse',
      description: 'Upload data to a Fabric Data Warehouse',
      inputSchema: {
        type: 'object',
        properties: {
          workspaceId: {
            type: 'string',
            description: 'The workspace ID',
          },
          warehouseId: {
            type: 'string',
            description: 'The data warehouse ID',
          },
          tableName: {
            type: 'string',
            description: 'Name of the table',
          },
          data: {
            type: 'array',
            description: 'Array of data rows to upload',
          },
        },
        required: ['workspaceId', 'warehouseId', 'tableName', 'data'],
      },
    },
  • Tool request handler in the MCP server that parses inputs and calls the fabricClient.
    case 'upload_to_datawarehouse': {
      const { workspaceId, warehouseId, tableName, data } = UploadToDataWarehouseSchema.parse(args);
      await fabricClient.uploadToDataWarehouse(workspaceId, warehouseId, tableName, data);
      return {
        content: [
          {
            type: 'text',
            text: `Data uploaded successfully to ${tableName}`,
          },
        ],
      };
    }

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