delete_node
Remove a specific node from Figma designs programmatically using the Cursor AI and Model Context Protocol integration.
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:797-826 (handler)The MCP server.tool registration defines the 'delete_node' tool, including its Zod input schema (nodeId: string) and handler function. The handler sends a 'delete_node' command with the nodeId to the Figma plugin via WebSocket (sendCommandToFigma), then returns a success message or error content block.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 for the delete_node tool input: requires a single 'nodeId' string parameter.{ nodeId: z.string().describe("The ID of the node to delete"), },
- src/talk_to_figma_mcp/server.ts:797-826 (registration)server.tool call that registers the 'delete_node' MCP tool with name, description, input schema, and handler implementation.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) }`, }, ], }; } } );