Skip to main content
Glama
grab

Talk to Figma MCP

by grab

move_node

Reposition a Figma design element by specifying its node ID and new X, Y coordinates, optimizing layout adjustments programmatically via natural language commands.

Instructions

Move a node to a new position in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesThe ID of the node to move
xYesNew X position
yYesNew Y position

Implementation Reference

  • Registration of the 'move_node' MCP tool including description, Zod input schema (nodeId, x, y), and inline handler function that delegates to Figma plugin via sendCommandToFigma.
    server.tool(
      "move_node",
      "Move a node to a new position in Figma",
      {
        nodeId: z.string().describe("The ID of the node to move"),
        x: z.number().describe("New X position"),
        y: z.number().describe("New Y position"),
      },
      async ({ nodeId, x, y }: any) => {
        try {
          const result = await sendCommandToFigma("move_node", { nodeId, x, y });
          const typedResult = result as { name: string };
          return {
            content: [
              {
                type: "text",
                text: `Moved node "${typedResult.name}" to position (${x}, ${y})`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error moving node: ${error instanceof Error ? error.message : String(error)
                  }`,
              },
            ],
          };
        }
      }
    );
  • The handler function for the move_node tool. It calls sendCommandToFigma with the parameters and formats a success or error response message.
    async ({ nodeId, x, y }: any) => {
      try {
        const result = await sendCommandToFigma("move_node", { nodeId, x, y });
        const typedResult = result as { name: string };
        return {
          content: [
            {
              type: "text",
              text: `Moved node "${typedResult.name}" to position (${x}, ${y})`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error moving node: ${error instanceof Error ? error.message : String(error)
                }`,
            },
          ],
        };
      }
    }
  • Zod schema for move_node tool input validation: nodeId (string), x (number), y (number).
      nodeId: z.string().describe("The ID of the node to move"),
      x: z.number().describe("New X position"),
      y: z.number().describe("New Y position"),
    },
  • TypeScript interface definition for move_node command parameters in CommandParams type, used for typing sendCommandToFigma calls.
    move_node: {
      nodeId: string;
      x: number;
      y: number;
    };
Install Server

Other Tools

Related 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/grab/cursor-talk-to-figma-mcp'

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