Skip to main content
Glama

gridstack_move_widget

Reposition widgets within GridStack dashboards by specifying new X and Y coordinates to adjust layout organization.

Instructions

Move a widget to a new position

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
elYesWidget selector or ID to move
xNoNew X position
yNoNew Y position

Implementation Reference

  • The primary handler function that implements the core logic for the 'gridstack_move_widget' tool. It destructures the input parameters (el, x, y) and generates the GridStack JavaScript code to move the widget using grid.move() via the utils.generateGridStackCode method.
    private async moveWidget(params: MoveWidgetParams): Promise<string> {
      const { el, x, y } = params;
    
      return this.utils.generateGridStackCode("moveWidget", {
        element: el,
        position: { x, y },
        code: `grid.move('${String(el)}', ${x}, ${y});`,
      });
    }
  • The input schema definition for the gridstack_move_widget tool, specifying required 'el' parameter and optional 'x' and 'y' positions.
    {
      name: "gridstack_move_widget",
      description: "Move a widget to a new position",
      inputSchema: {
        type: "object",
        required: ["el"],
        properties: {
          el: {
            type: "string",
            description: "Widget selector or ID to move",
          },
          x: {
            type: "number",
            description: "New X position",
          },
          y: {
            type: "number",
            description: "New Y position",
          },
        },
      },
    },
  • Registration and dispatching of the gridstack_move_widget tool in the callTool method's switch statement, casting args to MoveWidgetParams and calling the handler.
    case "gridstack_move_widget":
      return this.moveWidget(args as MoveWidgetParams);
  • TypeScript interface defining the input parameters for the moveWidget handler (el required, x and y optional).
    export interface MoveWidgetParams {
      el: string | HTMLElement;
      x?: number;
      y?: number;
    }
  • Utility helper method used by the handler to format and generate the standardized response including code, description, example, and notes for the move 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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Move a widget to a new position,' implying a mutation operation, but doesn't specify permissions required, whether the move is immediate or requires saving, error conditions, or side effects. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is a single, efficient sentence ('Move a widget to a new position') that front-loads the core action. It wastes no words and directly communicates the tool's function without redundancy, making it highly concise and well-structured.

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 complexity as a mutation operation with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., permissions, side effects), usage context, or return values. For a tool that modifies widget positions, more comprehensive guidance is needed to ensure correct invocation.

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?

The input schema has 100% description coverage, with clear documentation for 'el' (widget selector/ID), 'x' (new X position), and 'y' (new Y position). The description adds no additional meaning beyond the schema, such as coordinate systems or unit details. With high schema coverage, the baseline score of 3 is appropriate, as the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb ('Move') and resource ('a widget'), specifying the action of repositioning. It distinguishes from siblings like 'gridstack_resize_widget' or 'gridstack_update_widget' by focusing on position changes, though it doesn't explicitly name alternatives. This makes the purpose clear but lacks explicit sibling differentiation.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an initialized grid), exclusions, or compare to similar tools like 'gridstack_update_widget' (which might handle broader updates). Without such context, users must infer usage from the 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