Skip to main content
Glama

group_nodes

Combine multiple design elements into a single group in Figma to organize your workspace and manage related components together.

Instructions

Group nodes in Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdsYesArray of IDs of the nodes to group
nameNoOptional name for the group

Implementation Reference

  • Registration of the 'group_nodes' MCP tool using server.tool(), including description, Zod input schema, and inline handler function that forwards to Figma's group_nodes command.
    server.tool( "group_nodes", "Group nodes in Figma", { nodeIds: z.array(z.string()).describe("Array of IDs of the nodes to group"), name: z.string().optional().describe("Optional name for the group") }, async ({ nodeIds, name }) => { try { const result = await sendCommandToFigma("group_nodes", { nodeIds, name }); const typedResult = result as { id: string, name: string, type: string, children: Array<{ id: string, name: string, type: string }> }; return { content: [ { type: "text", text: `Nodes successfully grouped into "${typedResult.name}" with ID: ${typedResult.id}. The group contains ${typedResult.children.length} elements.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error grouping nodes: ${error instanceof Error ? error.message : String(error)}` } ] }; } } );
  • The execute function for the group_nodes tool. It calls sendCommandToFigma with the provided nodeIds and optional name, then returns a formatted text response with the new group ID and child count, or an error message.
    async ({ nodeIds, name }) => { try { const result = await sendCommandToFigma("group_nodes", { nodeIds, name }); const typedResult = result as { id: string, name: string, type: string, children: Array<{ id: string, name: string, type: string }> }; return { content: [ { type: "text", text: `Nodes successfully grouped into "${typedResult.name}" with ID: ${typedResult.id}. The group contains ${typedResult.children.length} elements.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error grouping nodes: ${error instanceof Error ? error.message : String(error)}` } ] }; } }
  • Zod schema defining the input parameters for the group_nodes tool: required array of node IDs and optional group name.
    { nodeIds: z.array(z.string()).describe("Array of IDs of the nodes to group"), name: z.string().optional().describe("Optional name for the group") },

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/agenisea/cc-fig-mcp'

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