delete_node
Remove a node from Figma designs programmatically using Cursor AI, enabling automation of design modifications through natural language commands.
Instructions
Delete a node from Figma
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/talk_to_figma_mcp/server.ts:796-826 (handler)MCP tool registration and handler implementation for 'delete_node'. The asynchronous handler function executes the tool logic by forwarding the 'delete_node' command with the provided nodeId to the underlying Figma plugin via sendCommandToFigma, handles success/error responses, and returns formatted content blocks.// Delete Node Tool 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 schema defining the input parameters for the delete_node tool: a required 'nodeId' string describing the ID of the node to delete.{ nodeId: z.string().describe("The ID of the node to delete"), },
- TypeScript type definition in CommandParams for delete_node parameters, reinforcing the schema with { nodeId: string }.delete_node: { nodeId: string; };