group_elements
Combine multiple diagram elements into a single group for easier organization and manipulation in Excalidraw diagrams.
Instructions
Group multiple elements together
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| elementIds | Yes |
Implementation Reference
- src/index.js:480-491 (handler)The handler function for the 'group_elements' tool. It parses the input arguments using ElementIdsSchema, generates a unique groupId, stores the elementIds in sceneState.groups Map, and returns a JSON response with the groupId and elementIds.case 'group_elements': { const params = ElementIdsSchema.parse(args); const { elementIds } = params; const groupId = generateId(); sceneState.groups.set(groupId, elementIds); const result = { groupId, elementIds }; return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/index.js:52-54 (schema)Zod schema used for input validation in the group_elements handler (and others). Defines required elementIds as array of strings.const ElementIdsSchema = z.object({ elementIds: z.array(z.string()) });
- src/index.js:184-196 (schema)Input schema definition for the group_elements tool in the MCP server capabilities declaration.group_elements: { description: 'Group multiple elements together', inputSchema: { type: 'object', properties: { elementIds: { type: 'array', items: { type: 'string' } } }, required: ['elementIds'] } },
- src/index.js:753-764 (registration)Tool registration in the ListToolsRequestHandler response, listing the group_elements tool with its schema.name: 'group_elements', description: 'Group multiple elements together', inputSchema: { type: 'object', properties: { elementIds: { type: 'array', items: { type: 'string' } } }, required: ['elementIds'] }