resize_node
Change the dimensions of a Figma design element by specifying a new width and height for precise layout adjustments.
Instructions
Resize a node in Figma
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | The ID of the node to resize | |
| width | Yes | New width | |
| height | Yes | New height |
Implementation Reference
- src/talk_to_figma_mcp/tools/modification-tools.ts:147-182 (registration)Registers the 'resize_node' MCP tool on the server, defining its input schema (nodeId, width, height) and handler function that sends a 'resize_node' command to Figma via websocket and returns a success/error text response.server.tool( "resize_node", "Resize a node in Figma", { nodeId: z.string().describe("The ID of the node to resize"), width: z.number().positive().describe("New width"), height: z.number().positive().describe("New height"), }, async ({ nodeId, width, height }) => { try { const result = await sendCommandToFigma("resize_node", { nodeId, width, height, }); const typedResult = result as { name: string }; return { content: [ { type: "text", text: `Resized node "${typedResult.name}" to width ${width} and height ${height}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error resizing node: ${error instanceof Error ? error.message : String(error)}`, }, ], }; } } );
- src/talk_to_figma_mcp/tools/index.ts:15-15 (registration)Higher-level registration call to registerModificationTools(server), which includes the resize_node tool registration.registerModificationTools(server);
- src/talk_to_figma_mcp/server.ts:34-34 (registration)Top-level registration call to registerTools(server), which triggers the chain leading to resize_node tool registration.registerTools(server);
- Type definition for FigmaCommand includes 'resize_node' as one of the possible commands sent internally to the Figma plugin.| "resize_node"