gridstack_batch_update
Enable batch update mode to optimize performance when making multiple widget or layout changes in GridStack.js dashboards.
Instructions
Enable/disable batch update mode for efficiency
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flag | No | Enable (true) or disable (false) batch mode |
Implementation Reference
- src/tools/index.ts:992-999 (handler)The handler function that implements the core logic for the 'gridstack_batch_update' tool. It extracts the 'flag' parameter and generates a JavaScript code snippet calling GridStack's batchUpdate method.private async batchUpdate(params: BatchUpdateParams): Promise<string> { const { flag = true } = params; return this.utils.generateGridStackCode("batchUpdate", { flag, code: `grid.batchUpdate(${flag});`, }); }
- src/tools/index.ts:379-392 (schema)The tool definition including name, description, and input schema for 'gridstack_batch_update' as returned by listTools().{ name: "gridstack_batch_update", description: "Enable/disable batch update mode for efficiency", inputSchema: { type: "object", properties: { flag: { type: "boolean", description: "Enable (true) or disable (false) batch mode", default: true, }, }, }, },
- src/tools/index.ts:801-802 (registration)The switch case in callTool() method that routes calls to the batchUpdate handler.case "gridstack_batch_update": return this.batchUpdate(args as BatchUpdateParams);
- src/types.ts:216-218 (schema)TypeScript interface defining the input parameters for the batchUpdate handler, matching the inputSchema.export interface BatchUpdateParams { flag?: boolean; }