Skip to main content
Glama
arinspunk

Claude Talk to Figma MCP

by arinspunk

move_node

Reposition design elements in Figma by specifying exact X and Y coordinates for precise layout adjustments.

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

  • The async handler function that implements the core logic of the move_node tool by forwarding the move command to Figma via websocket and returning a success or error message.
    async ({ nodeId, x, y }) => {
      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 input schema validating the parameters for the move_node tool: nodeId, x, and y.
    {
      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"),
    },
  • Registration of the move_node MCP tool on the server, including name, description, input schema, and handler function.
      "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 }) => {
        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)}`,
              },
            ],
          };
        }
      }
    );
  • Higher-level registration call that invokes registerModificationTools, which includes the move_node tool.
    registerModificationTools(server);

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/arinspunk/claude-talk-to-figma-mcp'

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