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
| Name | Required | Description | Default |
|---|---|---|---|
| workspaceId | Yes | The workspace ID | |
| warehouseId | Yes | The data warehouse ID | |
| tableName | Yes | Name of the table | |
| data | Yes | Array of data rows to upload |
Implementation Reference
- src/fabric-client.ts:76-88 (handler)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; } } - src/index.ts:33-38 (schema)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'], }, }, - src/index.ts:222-233 (handler)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}`, }, ], }; }