gridstack_resize_widget
Resize dashboard widgets by specifying new width in columns and height in rows. Modify widget dimensions to optimize dashboard layouts and improve visual organization.
Instructions
Resize a widget
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| el | Yes | Widget selector or ID to resize | |
| width | No | New width in columns | |
| height | No | New height in rows |
Implementation Reference
- src/tools/index.ts:926-934 (handler)The main handler function that implements the core logic for the 'gridstack_resize_widget' tool by generating the appropriate GridStack.js resize code.private async resizeWidget(params: ResizeWidgetParams): Promise<string> { const { el, width, height } = params; return this.utils.generateGridStackCode("resizeWidget", { element: el, size: { width, height }, code: `grid.resize('${String(el)}', ${width}, ${height});`, }); }
- src/tools/index.ts:259-280 (registration)Registration of the 'gridstack_resize_widget' tool in the listTools() method, including name, description, and input schema.{ name: "gridstack_resize_widget", description: "Resize a widget", inputSchema: { type: "object", required: ["el"], properties: { el: { type: "string", description: "Widget selector or ID to resize", }, width: { type: "number", description: "New width in columns", }, height: { type: "number", description: "New height in rows", }, }, }, },
- src/tools/index.ts:783-784 (registration)Dispatch registration in the callTool switch statement that calls the specific resizeWidget handler.case "gridstack_resize_widget": return this.resizeWidget(args as ResizeWidgetParams);
- src/types.ts:200-204 (schema)TypeScript interface defining the input parameters for the resize widget tool, matching the inputSchema.export interface ResizeWidgetParams { el: string | HTMLElement; width?: number; height?: number; }