move_node
Reposition a Figma design element to a new location using natural language commands for efficient design adjustments.
Instructions
Move a node to a new position in Figma
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/talk_to_figma_mcp/tools/modification-tools.ts:113-144 (registration)Registration of the 'move_node' MCP tool using server.tool(), including description, Zod input schema, and handler function that delegates to Figma 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 }) => { 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)}`, }, ], }; } } );
- Handler function that executes the move_node tool logic: sends 'move_node' command to Figma WebSocket with nodeId, x, y; returns formatted success message with node name or error.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)}`, }, ], }; } }
- Input schema defined with Zod validators for 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"), },
- FigmaCommand type union includes "move_node" as a valid command type for type safety.| "move_node"