group_elements
Group multiple elements in Excalidraw diagrams by specifying their IDs for better organization and structure within the drawing interface.
Instructions
Group multiple elements together
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| elementIds | Yes |
Implementation Reference
- src/index.js:480-491 (handler)Executes the group_elements tool: validates input with ElementIdsSchema, generates a unique groupId, stores the elementIds in sceneState.groups Map, and returns 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 for input validation of elementIds array, used in group_elements (and similar tools) handler.const ElementIdsSchema = z.object({ elementIds: z.array(z.string()) });
- src/index.js:184-195 (registration)Registers the group_elements tool in the MCP server capabilities, providing description and input schema.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)Registers the group_elements tool in the ListToolsRequestHandler response.name: 'group_elements', description: 'Group multiple elements together', inputSchema: { type: 'object', properties: { elementIds: { type: 'array', items: { type: 'string' } } }, required: ['elementIds'] }