Skip to main content
Glama

resize_node

Resize Figma design elements by specifying new width and height dimensions for precise layout adjustments.

Instructions

Resize a node in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe ID of the node to resize
widthYesNew width
heightYesNew height

Implementation Reference

  • The handler function for the resize_node tool. It sends a 'resize_node' command to the Figma plugin via WebSocket with parameters nodeId, width, and height, handles the response, and returns a formatted message or error.
    async ({ nodeId, width, height }) => {
      try {
        const result = await sendCommandToFigma("resize_node", {
          nodeId,
          width,
          height,
        });
        const typedResult = result as { name: string };
        return {
          content: [
            {
              type: "text",
              text: `Resized node "${typedResult.name}" to width ${width} and height ${height}`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error resizing node: ${error instanceof Error ? error.message : String(error)
                }`,
            },
          ],
        };
      }
    }
  • Zod input schema defining parameters for resize_node: nodeId (string), width (positive number), height (positive number).
    {
      nodeId: z.string().describe("The ID of the node to resize"),
      width: z.number().positive().describe("New width"),
      height: z.number().positive().describe("New height"),
    },
  • MCP server.tool registration for the resize_node tool, specifying name, description, input schema, and handler function.
    server.tool(
      "resize_node",
      "Resize a node in Figma",
      {
        nodeId: z.string().describe("The ID of the node to resize"),
        width: z.number().positive().describe("New width"),
        height: z.number().positive().describe("New height"),
      },
      async ({ nodeId, width, height }) => {
        try {
          const result = await sendCommandToFigma("resize_node", {
            nodeId,
            width,
            height,
          });
          const typedResult = result as { name: string };
          return {
            content: [
              {
                type: "text",
                text: `Resized node "${typedResult.name}" to width ${width} and height ${height}`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error resizing node: ${error instanceof Error ? error.message : String(error)
                  }`,
              },
            ],
          };
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Resize' implies a mutation operation, but the description doesn't state whether this requires edit permissions, whether it's destructive to existing content, what happens with constraints or auto-layout, or what the response looks like. 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 with zero waste. It's appropriately sized for a simple tool and front-loads the core purpose immediately. Every word earns its place without redundancy or unnecessary elaboration.

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 this is a mutation tool with no annotations, no output schema, and 3 required parameters, the description is incomplete. It doesn't address behavioral aspects like permissions, constraints, or response format. The 100% schema coverage helps with parameters, but overall context for safe and effective use is lacking.

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%, with all parameters (nodeId, width, height) well-documented in the schema. The description adds no additional parameter semantics beyond what's already in the structured schema. Baseline 3 is appropriate when the schema does the heavy lifting for parameter documentation.

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 'Resize a node in Figma' clearly states the action (resize) and target resource (node in Figma). It's specific but doesn't distinguish from sibling tools like 'move_node' or 'set_layout_sizing' which might also affect node dimensions. The purpose is unambiguous but lacks 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. There's no mention of prerequisites (e.g., needing node permissions), when not to use it (e.g., for text nodes vs. shapes), or comparison to similar tools like 'set_layout_sizing' or 'move_node' that might affect size indirectly. Usage is implied but not articulated.

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/pipethedev/Talk-to-Figma-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server