Groups
Your AI assistant uses these tools to group elements together so they move and resize as a unit, or ungroup them when you need to edit individually.
Grouping is useful when multiple elements form a visual unit — like a title bar with an accent line and body text. Once grouped, moving or resizing one element affects all members of the group.
Grouping Elements Together
When you ask to “group these elements” or your assistant wants to lock related elements together, it uses slides_group_elements. All elements must be on the same slide and not already in a group.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
deckId | string | Yes | The deck ID |
elementIds | string[] | Yes | Array of element IDs to group (at least 2). All must be on the same slide and not already in a group |
groupId | string | No | Custom group ID. Auto-generated if omitted |
What It Returns
groupId— the group's ID (use this to ungroup later)memberCount— number of elements in the groupslideId,slideNumber— which slide the group is on
Example
slides_group_elements({
deckId: "deck_abc123",
elementIds: ["elem_001", "elem_002", "elem_003"]
})
// Response:
// {
// groupId: "group_xyz789",
// memberCount: 3,
// slideId: "slide_002",
// slideNumber: 2
// }Example — Custom Group ID
// Use a custom group ID for easier reference
slides_group_elements({
deckId: "deck_abc123",
elementIds: ["elem_title", "elem_accent", "elem_body"],
groupId: "header-group"
})Creating Pre-Grouped Elements
Instead of creating elements and then grouping them in a second step, your assistant can pass a shared groupId to slides_bulk_create_elements to create them already grouped:
// Create pre-grouped elements in one call
slides_bulk_create_elements({
deckId: "deck_abc123",
slideId: "slide_002",
elements: [
{
elementType: "shape",
shapeType: "rectangle",
x: 60, y: 40,
width: 500, height: 80,
fillColor: "#1C2833",
text: "Revenue",
fontSize: 36,
textColor: "#FFFFFF",
role: "title",
groupId: "header-block"
},
{
elementType: "line",
startX: 60, startY: 130,
endX: 400, endY: 130,
strokeColor: "#5EA8A7",
strokeWidth: 3,
groupId: "header-block"
}
]
})
// Both elements are created already grouped under "header-block"Ungrouping Elements
When you need to edit grouped elements independently, your assistant uses slides_ungroup_elements to dissolve the group. All elements become independent again but stay in their current positions.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
deckId | string | Yes | The deck ID |
groupId | string | Yes | The group ID to dissolve. Find group IDs via slides_get_slides |
What It Returns
success— whether the ungroup succeededungroupedCount— number of elements that were freedslideId,slideNumber— which slide the elements are on
Example
slides_ungroup_elements({
deckId: "deck_abc123",
groupId: "group_xyz789"
})
// Response:
// {
// success: true,
// groupId: "group_xyz789",
// ungroupedCount: 3,
// slideId: "slide_002",
// slideNumber: 2
// }Constraints
- Minimum 2 elements — you can't group a single element
- Same slide — all elements must be on the same slide
- Not already grouped — elements can only belong to one group at a time. Ungroup first if you need to regroup
Related
- Element Operations — Create elements with a shared groupId via slides_bulk_create_elements
- Slide Operations — Use slides_get_slides to find group IDs on a slide
- Design Techniques — Visual design patterns that benefit from grouping