delete_node
Remove specific nodes from Figma designs using natural language commands, enabling precise editing and AI-assisted workflow integration.
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
- The handler function that implements the core logic of the delete_node tool by sending the delete command to Figma via WebSocket and handling the response.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 nodeId string parameter.{ nodeId: z.string().describe("The ID of the node to delete"), },
- src/talk_to_figma_mcp/tools/modification-tools.ts:185-213 (registration)The server.tool() call that registers the delete_node tool with the MCP server, including description, schema, and handler.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)}`, }, ], }; } } );
- src/talk_to_figma_mcp/tools/index.ts:16-16 (registration)Top-level registration call for modification tools, which includes the delete_node tool.registerModificationTools(server);
- FigmaCommand type definition includes 'delete_node' as a valid command type for sendCommandToFigma.| "delete_node"