delete_multiple_nodes
Remove multiple design elements simultaneously from Figma files to streamline cleanup and organization tasks.
Instructions
Delete multiple nodes from Figma at once
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeIds | Yes | Array of node IDs to delete |
Implementation Reference
- src/talk_to_figma_mcp/server.ts:829-858 (handler)The handler function that executes the 'delete_multiple_nodes' MCP tool. It proxies the call to the Figma plugin by sending a 'delete_multiple_nodes' command with the provided nodeIds via sendCommandToFigma, then returns the result as content or an error message.server.tool( "delete_multiple_nodes", "Delete multiple nodes from Figma at once", { nodeIds: z.array(z.string()).describe("Array of node IDs to delete"), }, async ({ nodeIds }) => { try { const result = await sendCommandToFigma("delete_multiple_nodes", { nodeIds }); return { content: [ { type: "text", text: JSON.stringify(result) } ] }; } catch (error) { return { content: [ { type: "text", text: `Error deleting multiple nodes: ${error instanceof Error ? error.message : String(error) }`, }, ], }; } } );
- The input schema for the 'delete_multiple_nodes' tool using Zod: an array of node ID strings.{ nodeIds: z.array(z.string()).describe("Array of node IDs to delete"), },
- src/talk_to_figma_mcp/server.ts:829-858 (registration)The registration of the 'delete_multiple_nodes' tool on the MCP server using server.tool(), including name, description, schema, and handler.server.tool( "delete_multiple_nodes", "Delete multiple nodes from Figma at once", { nodeIds: z.array(z.string()).describe("Array of node IDs to delete"), }, async ({ nodeIds }) => { try { const result = await sendCommandToFigma("delete_multiple_nodes", { nodeIds }); return { content: [ { type: "text", text: JSON.stringify(result) } ] }; } catch (error) { return { content: [ { type: "text", text: `Error deleting multiple nodes: ${error instanceof Error ? error.message : String(error) }`, }, ], }; } } );