ungroup_elements
Separate grouped elements in Excalidraw diagrams to edit individual components independently.
Instructions
Ungroup a group of elements
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupId | Yes |
Implementation Reference
- src/index.js:493-508 (handler)The main handler logic for the 'ungroup_elements' tool. It validates the input using GroupIdSchema, checks if the group exists in sceneState.groups, retrieves the element IDs, deletes the group, and returns a success response with the details.case 'ungroup_elements': { const params = GroupIdSchema.parse(args); const { groupId } = params; if (!sceneState.groups.has(groupId)) { throw new Error(`Group ${groupId} not found`); } const elementIds = sceneState.groups.get(groupId); sceneState.groups.delete(groupId); const result = { groupId, ungrouped: true, elementIds }; return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/index.js:56-58 (schema)Zod schema used for input validation of the groupId parameter in the ungroup_elements handler.const GroupIdSchema = z.object({ groupId: z.string() });
- src/index.js:197-206 (registration)Tool registration in the MCP server capabilities, including the description and input schema definition.ungroup_elements: { description: 'Ungroup a group of elements', inputSchema: { type: 'object', properties: { groupId: { type: 'string' } }, required: ['groupId'] } },
- src/index.js:767-775 (schema)Duplicate schema definition in the ListToolsRequestHandler for consistency.name: 'ungroup_elements', description: 'Ungroup a group of elements', inputSchema: { type: 'object', properties: { groupId: { type: 'string' } }, required: ['groupId'] }