delete_node
Remove a specific node from Figma designs programmatically using Cursor AI and the MCP server integration for streamlined design management and updates.
Instructions
Delete a node from Figma
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/talk_to_figma_mcp/server.ts:766-796 (handler)MCP tool handler and registration for 'delete_node'. This defines the tool, its input schema (nodeId), and the execution logic which proxies the delete_node command to the Figma plugin via sendCommandToFigma WebSocket function.// 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) }`, }, ], }; } } );