# collapse_sheet_group (https://sellersheetai.com/docs/mcp-api/tools/collapse_sheet_group)

> Collapse (collapsed=True) or expand the row or column groups that lie inside range_.

Access: **WRITE** · toolset google_workspace · family null

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

MCP tool call:

```json
{
  "name": "collapse_sheet_group",
  "arguments": {
    "spreadsheet_id": "<spreadsheet_id>",
    "range_": "<range_>"
  }
}
```

Tool API (early access — contact us):

```bash
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_>"}'
```

## Arguments

| Name | Type | Required | Description |
|---|---|---|---|
| `spreadsheet_id` | string | yes | the spreadsheet ID (from its URL or get_sheet_metadata). |
| `range_` | string | yes | A1 range covering the grouped dimension. |
| `dimension` | string |  | 'COLUMNS' or 'ROWS'. |
| `collapsed` | boolean |  | True to collapse, False to expand. |

## Result

- { 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)