Skip to main content
Glama

gridstack_resize_widget

Resize dashboard widgets by specifying new width and height dimensions to adjust layout elements dynamically.

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

  • Main handler function that executes the tool logic: extracts parameters, generates the GridStack 'grid.resize()' code snippet, and formats response via utility.
    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});`,
      });
    }
  • Tool registration entry in GridStackTools.listTools() array, defining name, description, and input schema for MCP tool discovery.
    {
      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",
          },
        },
      },
    },
  • Type definition for tool input parameters, used for TypeScript typing and parameter destructuring in handler.
    export interface ResizeWidgetParams {
      el: string | HTMLElement;
      width?: number;
      height?: number;
    }
  • Dispatch case in GridStackTools.callTool() switch statement that routes tool calls to the resizeWidget handler.
    case "gridstack_resize_widget":
      return this.resizeWidget(args as ResizeWidgetParams);
  • Utility method called by handler to format the response with code snippet, parameters, description, example, and notes for the resize operation.
    generateGridStackCode(operation: string, params: any): string {
      const result: GridStackCodeResult = {
        operation,
        parameters: params,
        code: params.code || "",
        description: this.getOperationDescription(operation),
        example: this.getOperationExample(operation),
        notes: this.getOperationNotes(operation),
      };
    
      return this.formatResponse(result);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool resizes a widget, implying a mutation operation, but doesn't mention side effects (e.g., layout changes), permissions required, error conditions, or response format. This leaves significant gaps in understanding how the tool behaves beyond its basic function.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise ('Resize a widget'), which is efficient and front-loaded. However, it's arguably too brief, bordering on under-specified, as it lacks any context or detail that could aid the agent. It earns a 4 for zero waste but loses a point for potential under-specification.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's mutation nature (resizing implies change), no annotations, no output schema, and a vague description, the description is incomplete. It doesn't address behavioral aspects, usage context, or output expectations, making it inadequate for an agent to confidently invoke this tool without additional inference or trial-and-error.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the input schema fully documents parameters (el, width, height) with descriptions. The description adds no additional meaning beyond what's in the schema, such as unit clarifications or constraints on width/height values. Baseline 3 is appropriate as the schema handles parameter documentation adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Resize a widget' clearly states the action (resize) and target (widget), but it's vague about scope and doesn't differentiate from siblings like 'gridstack_update_widget' or 'gridstack_move_widget' which might also modify widget dimensions. It provides basic purpose but lacks specificity about what 'resize' entails in this context.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives such as 'gridstack_update_widget' or 'gridstack_move_widget', which might handle similar operations. The description offers no context about prerequisites, constraints, or typical use cases, leaving the agent to infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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