Skip to main content
Glama

gridstack_off

Remove event listeners from GridStack.js dashboard elements to manage widget interactions and optimize performance by eliminating unnecessary callbacks.

Instructions

Remove event listener

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventNameYesEvent name to remove listener for

Implementation Reference

  • The core handler function for the 'gridstack_off' tool. It extracts the eventName from input parameters and generates JavaScript code to remove the GridStack event listener using grid.off(eventName). Delegates formatting to GridStackUtils.
    private async removeEventListener(params: any): Promise<string> { const { eventName } = params; return this.utils.generateGridStackCode("removeEventListener", { eventName, code: `grid.off('${eventName}');`, }); }
  • Input schema definition for the 'gridstack_off' tool, specifying the required 'eventName' parameter with valid GridStack event enums.
    { name: "gridstack_off", description: "Remove event listener", inputSchema: { type: "object", required: ["eventName"], properties: { eventName: { type: "string", enum: [ "added", "change", "disable", "drag", "dragstart", "dragstop", "dropped", "enable", "removed", "resize", "resizestart", "resizestop", ], description: "Event name to remove listener for", }, }, }, },
  • Registration in the tool dispatcher switch statement within callTool method, mapping 'gridstack_off' calls to the removeEventListener handler.
    case "gridstack_off": return this.removeEventListener(args);
  • Helper utility method used by the handler to format and generate the standardized response including code, description, parameters, example, and notes for the grid.off operation.
    generateGridStackCode(operation: string, params: any): string { const result: GridStackCodeResult = { operation, parameters: params, code: params.code || "", description: this.getOperationDescription(operation), example: this.getOperationExample(operation), notes: this.getOperationNotes(operation), }; return this.formatResponse(result); }
  • The 'gridstack_off' tool is registered by being included in the array returned by listTools(), making it discoverable by MCP clients.
    ];

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