gridstack_column
Change the number of columns in dynamic dashboard layouts to adjust widget positioning and grid structure for responsive design.
Instructions
Change the number of columns
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| column | Yes | Number of columns or 'auto' | |
| layout | No | How to re-layout widgets | moveScale |
Implementation Reference
- src/tools/index.ts:955-965 (handler)The core handler function that executes the gridstack_column tool logic. It generates JavaScript code calling GridStack's grid.column() method with the provided column count and layout, formatted via GridStackUtils.private async column(params: ColumnParams): Promise<string> { const { column, layout = "moveScale" } = params; return this.utils.generateGridStackCode("column", { column, layout, code: `grid.column(${ typeof column === "string" ? `'${column}'` : column }, '${layout}');`, }); }
- src/tools/index.ts:321-336 (schema)JSON schema defining the input parameters for the gridstack_column tool: required 'column' (number or 'auto'), optional 'layout'.inputSchema: { type: "object", required: ["column"], properties: { column: { oneOf: [{ type: "number" }, { type: "string", enum: ["auto"] }], description: "Number of columns or 'auto'", }, layout: { type: "string", enum: ["moveScale", "move", "scale", "none", "list"], description: "How to re-layout widgets", default: "moveScale", }, }, },
- src/tools/index.ts:318-337 (registration)Tool registration object in listTools() array, defining name, description, and input schema for MCP tool discovery.{ name: "gridstack_column", description: "Change the number of columns", inputSchema: { type: "object", required: ["column"], properties: { column: { oneOf: [{ type: "number" }, { type: "string", enum: ["auto"] }], description: "Number of columns or 'auto'", }, layout: { type: "string", enum: ["moveScale", "move", "scale", "none", "list"], description: "How to re-layout widgets", default: "moveScale", }, }, }, },
- src/tools/index.ts:792-793 (registration)Switch case in callTool() method that dispatches execution of gridstack_column to the dedicated handler function.case "gridstack_column": return this.column(args as ColumnParams);