collapse_sheet_group
Collapse (collapsed=True) or expand the row or column groups that lie inside range_.
writeGoogle Sheets, Docs & Drive
This flips each group's toggle and hides or shows its rows or columns. A range with no group inside is refused; to show rows hidden without a group, use hide_sheet_rows with hidden false.
Call it
In an AI client (MCP)
{
"name": "collapse_sheet_group",
"arguments": {
"spreadsheet_id": "<spreadsheet_id>",
"range_": "<range_>"
}
}From code (Tool API)
curl -X POST https://api.sellersheetai.com/api/v1/tools/collapse_sheet_group \
-H "Authorization: Bearer $SELLERSHEET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"spreadsheet_id":"<spreadsheet_id>","range_":"<range_>"}'Early access — the Tool API is open on request, contact us.
Arguments
| Name | Type | Description |
|---|---|---|
spreadsheet_idrequired | string | the spreadsheet ID (from its URL or get_sheet_metadata). |
range_required | string | A1 range covering the grouped dimension. |
dimension | string | 'COLUMNS' or 'ROWS'.Default: "COLUMNS" |
collapsed | boolean | True to collapse, False to expand.Default: true |
Result
Every tool answers {notification, data, human_action}; data carries:
- { sheetId, collapsed: bool, groups: the number of groups flipped }
Gotchas
- Every range here must name its tab; an open end is allowed ('Tab!C7:C' runs to the bottom, 'Tab!A:D' is whole columns); a range without a tab ('A1:D10') is refused. The grouped axis needs both ends ('Tab!C:F', 'Tab!5:20').
Example
collapse_sheet_group("1ABC...", "Listing!F1:J1", "COLUMNS", True)