Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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"), },
  • 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) }`, }, ], }; } } );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pipethedev/Talk-to-Figma-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server