ungroup_nodes
Ungroup selected Figma elements to edit individual components within a group or frame.
Instructions
Ungroup nodes in Figma
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | ID of the node (group or frame) to ungroup |
Implementation Reference
- src/talk_to_figma_mcp/tools/creation-tools.ts:467-502 (registration)Registration of the 'ungroup_nodes' MCP tool, including schema, description, and full handler implementation that proxies to Figma's ungroup_nodes command.server.tool( "ungroup_nodes", "Ungroup nodes in Figma", { nodeId: z.string().describe("ID of the node (group or frame) to ungroup"), }, async ({ nodeId }) => { try { const result = await sendCommandToFigma("ungroup_nodes", { nodeId }); const typedResult = result as { success: boolean, ungroupedCount: number, items: Array<{ id: string, name: string, type: string }> }; return { content: [ { type: "text", text: `Node successfully ungrouped. ${typedResult.ungroupedCount} elements were released.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error ungrouping node: ${error instanceof Error ? error.message : String(error)}` } ] }; } } );
- The core handler logic for executing the ungroup_nodes tool: sends command to Figma WebSocket, type-asserts response, and formats success/error text response.async ({ nodeId }) => { try { const result = await sendCommandToFigma("ungroup_nodes", { nodeId }); const typedResult = result as { success: boolean, ungroupedCount: number, items: Array<{ id: string, name: string, type: string }> }; return { content: [ { type: "text", text: `Node successfully ungrouped. ${typedResult.ungroupedCount} elements were released.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error ungrouping node: ${error instanceof Error ? error.message : String(error)}` } ] }; } }
- Zod schema defining the input parameters for the ungroup_nodes tool (requires nodeId: string).{ nodeId: z.string().describe("ID of the node (group or frame) to ungroup"), },
- TypeScript type FigmaCommand lists "ungroup_nodes" as a valid command type used in sendCommandToFigma.export type FigmaCommand = | "get_document_info" | "get_selection" | "get_node_info" | "create_rectangle" | "create_frame" | "create_text" | "create_ellipse" | "create_polygon" | "create_star" | "create_vector" | "create_line" | "set_fill_color" | "set_stroke_color" | "move_node" | "resize_node" | "delete_node" | "get_styles" | "get_local_components" | "get_team_components" | "create_component_instance" | "export_node_as_image" | "join" | "set_corner_radius" | "clone_node" | "set_text_content" | "scan_text_nodes" | "set_multiple_text_contents" | "set_auto_layout" | "set_font_name" | "set_font_size" | "set_font_weight" | "set_letter_spacing" | "set_line_height" | "set_paragraph_spacing" | "set_text_case" | "set_text_decoration" | "get_styled_text_segments" | "load_font_async" | "get_remote_components" | "set_effects" | "set_effect_style_id" | "group_nodes" | "ungroup_nodes" | "flatten_node" | "insert_child";