move_node
Reposition a node to a specific location in Figma using the 'Talk to Figma MCP' integration, enabling precise adjustments for design layouts.
Instructions
Move a node to a new position in Figma
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/talk_to_figma_mcp/server.ts:688-721 (registration)Registration of the 'move_node' MCP tool, including inline schema and handler function that proxies the move_node command to the Figma plugin via WebSocket.// Move Node Tool 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 }) => { 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/server.ts:697-720 (handler)Handler function implementing the tool logic: sends 'move_node' command with parameters to Figma plugin and formats success/error response.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 schema defining input parameters: 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 type definition for FigmaCommand parameters of move_node.move_node: { nodeId: string; x: number; y: number; };