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
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | The ID of the node to move | |
| x | Yes | New X position | |
| y | Yes | New 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"), },
- src/talk_to_figma_mcp/tools/modification-tools.ts:114-144 (registration)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)}`, }, ], }; } } );
- src/talk_to_figma_mcp/tools/index.ts:16-16 (registration)Higher-level registration call that invokes registerModificationTools, which includes the move_node tool.registerModificationTools(server);