Skip to main content
Glama

gridstack_add_grid

Create a new grid layout with customizable options and child widgets for building dynamic dashboard interfaces and responsive drag-and-drop systems.

Instructions

Create a new grid with options and children (static method)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
parentYesParent element selector
optNoGrid options including children

Implementation Reference

  • The handler function for 'gridstack_add_grid' that destructures params and generates code calling the static GridStack.addGrid method.
    private async addGrid(params: any): Promise<string> { const { parent, opt = {} } = params; return this.utils.generateGridStackCode("addGrid", { parent, options: opt, code: `const grid = GridStack.addGrid('${parent}', ${JSON.stringify( opt, null, 2 )});`, }); }
  • Input schema definition for the gridstack_add_grid tool, specifying required 'parent' and optional 'opt' with children array.
    { name: "gridstack_add_grid", description: "Create a new grid with options and children (static method)", inputSchema: { type: "object", required: ["parent"], properties: { parent: { type: "string", description: "Parent element selector", }, opt: { type: "object", description: "Grid options including children", properties: { children: { type: "array", items: { type: "object", description: "Child widget configuration", }, description: "Array of child widgets to load", }, }, }, }, }, },
  • Switch case in callTool method that registers and routes 'gridstack_add_grid' to the addGrid handler.
    case "gridstack_add_grid": return this.addGrid(args);

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