Skip to main content
Glama

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
NameRequiredDescriptionDefault
elYesWidget selector or ID to resize
widthNoNew width in columns
heightNoNew height in rows

Implementation Reference

  • 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});`, }); }
  • 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", }, }, }, },
  • Dispatch registration in the callTool switch statement that calls the specific resizeWidget handler.
    case "gridstack_resize_widget": return this.resizeWidget(args as ResizeWidgetParams);
  • TypeScript interface defining the input parameters for the resize widget tool, matching the inputSchema.
    export interface ResizeWidgetParams { el: string | HTMLElement; width?: number; height?: number; }

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