Skip to main content
Glama

group_nodes

Combine Figma design elements into groups for better organization and streamlined workflows using natural language commands via AI tools.

Instructions

Group nodes in Figma

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": {}, "type": "object" }

Implementation Reference

  • Registration of the 'group_nodes' MCP tool, including inline Zod input schema and async handler function that executes the grouping by sending a WebSocket command to Figma and returns success/error response.
    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 handler function for the 'group_nodes' tool that validates input, sends the group_nodes command to Figma via sendCommandToFigma utility, type-casts the response, and returns a textual summary of the result.
    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)}` } ] }; } }
  • Inline Zod schema for 'group_nodes' tool input: array of node IDs (required) 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") },
  • FigmaCommand type union includes 'group_nodes' for type safety in command sending.
    | "group_nodes" | "ungroup_nodes" | "flatten_node" | "insert_child";
  • Higher-level registration call to registerCreationTools, which includes the group_nodes tool.
    registerCreationTools(server);

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/arinspunk/claude-talk-to-figma-mcp'

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