resize_node
Modify dimensions of a Figma node to adjust its size programmatically, enabling automated design updates through natural language commands.
Instructions
Resize a node in Figma
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/talk_to_figma_mcp/server.ts:758-794 (registration)Registration of the 'resize_node' MCP tool, including input schema (nodeId, width, height) and thin handler that forwards to Figma plugin's resize_node command via sendCommandToFigma, with success/error responses.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) }`, }, ], }; } } );
- Zod input schema for resize_node tool parameters.{ 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"), },
- src/talk_to_figma_mcp/server.ts:766-793 (handler)Handler function for resize_node tool that calls the underlying Figma plugin command and formats the response.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) }`, }, ], }; } }
- TypeScript type definition for resize_node command parameters in CommandParams.resize_node: { nodeId: string; width: number; height: number; };