delete_node
Remove a specific node from Figma designs using its ID to manage and update design elements programmatically.
Instructions
Delete a node from Figma
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | The ID of the node to delete |
Implementation Reference
- src/talk_to_figma_mcp/server.ts:797-826 (handler)The complete MCP tool definition for 'delete_node', including registration with McpServer, input schema validation using Zod (nodeId: string), and the handler function that proxies the delete_node command to the underlying Figma plugin via WebSocket (sendCommandToFigma), with proper error handling and response formatting.server.tool( "delete_node", "Delete a node from Figma", { nodeId: z.string().describe("The ID of the node to delete"), }, async ({ nodeId }) => { try { await sendCommandToFigma("delete_node", { nodeId }); return { content: [ { type: "text", text: `Deleted node with ID: ${nodeId}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error deleting node: ${error instanceof Error ? error.message : String(error) }`, }, ], }; } } );
- Zod input schema for the delete_node tool, requiring a single string parameter 'nodeId'.{ nodeId: z.string().describe("The ID of the node to delete"), },
- src/talk_to_figma_mcp/server.ts:797-797 (registration)Registration of the 'delete_node' tool with the MCP server using server.tool(), specifying name, description, input schema, and handler.server.tool(