delete_node
Remove a specific element from Figma designs by providing its node ID, enabling automated cleanup and modification of design files.
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 implementation of the 'delete_node' tool, including registration, input schema, and handler function. The handler sends a 'delete_node' command to the Figma plugin and handles the response.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) }`, }, ], }; } } );