gridstack_column
Adjust the column count in GridStack layouts to control widget arrangement and responsiveness. Specify a number or 'auto' to optimize dashboard grid structure.
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 for the 'gridstack_column' tool. It destructures the input parameters (column count and optional layout strategy), constructs the GridStack 'column' method call as a string, and delegates to GridStackUtils.generateGridStackCode to format the response.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:318-337 (registration)Tool registration in GridStackTools.listTools(). Defines the tool name, description, and input schema for validating parameters like column count and layout option.{ 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/types.ts:229-232 (schema)TypeScript interface defining the input parameters for the gridstack_column tool, used for type safety in the handler.export interface ColumnParams { column: number | "auto"; layout?: ColumnOptions; }
- src/tools/index.ts:792-793 (registration)Switch case in GridStackTools.callTool() that routes calls to the specific column handler method.case "gridstack_column": return this.column(args as ColumnParams);
- src/tools/index.ts:958-965 (helper)Invocation of the shared helper GridStackUtils.generateGridStackCode specific to column operation, which formats the response with description, example, and notes.return this.utils.generateGridStackCode("column", { column, layout, code: `grid.column(${ typeof column === "string" ? `'${column}'` : column }, '${layout}');`, }); }