gridstack_cell_height
Adjust the height of grid cells to customize dashboard layouts, supporting pixel values, CSS units, or automatic sizing.
Instructions
Update cell height
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "gridstack_cell_height"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| val | No | New cell height (px, 'auto', 'initial', CSS units) | |
| update | No | Update existing widgets |
Implementation Reference
- src/tools/index.ts:967-980 (handler)The handler function that implements the core logic for the 'gridstack_cell_height' tool. It generates the GridStack.js 'cellHeight' method call based on input parameters and uses the GridStackUtils helper to produce executable JavaScript code.
private async cellHeight(params: CellHeightParams): Promise<string> { const { val, update = true } = params; return this.utils.generateGridStackCode("cellHeight", { value: val, update, code: val !== undefined ? `grid.cellHeight(${ typeof val === "string" ? `'${val}'` : val }, ${update});` : `grid.cellHeight();`, }); } - src/tools/index.ts:339-356 (schema)The JSON schema defining the input parameters for the 'gridstack_cell_height' tool: 'val' for the new cell height value and optional 'update' boolean.
{ name: "gridstack_cell_height", description: "Update cell height", inputSchema: { type: "object", properties: { val: { oneOf: [{ type: "number" }, { type: "string" }], description: "New cell height (px, 'auto', 'initial', CSS units)", }, update: { type: "boolean", description: "Update existing widgets", default: true, }, }, }, }, - src/tools/index.ts:795-796 (registration)The switch case in callTool method that registers and dispatches calls to the specific cellHeight handler for the tool name 'gridstack_cell_height'.
case "gridstack_cell_height": return this.cellHeight(args as CellHeightParams);