Skip to main content
Glama

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
NameRequiredDescriptionDefault
flagNoEnable (true) or disable (false) batch mode

Implementation Reference

  • 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});`,
      });
    }
  • 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,
          },
        },
      },
    },
  • The switch case in callTool() method that routes calls to the batchUpdate handler.
    case "gridstack_batch_update":
      return this.batchUpdate(args as BatchUpdateParams);
  • TypeScript interface defining the input parameters for the batchUpdate handler, matching the inputSchema.
    export interface BatchUpdateParams {
      flag?: boolean;
    }

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/raghavsharma-simpplr/gridstack-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server