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

> Group rows or columns (creates a collapsible [+] toggle in the sheet).

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

## Call it

MCP tool call:

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

Tool API (early access — contact us):

```bash
curl -X POST https://api.sellersheetai.com/api/v1/tools/group_sheet_rows_cols \
  -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 with sheet name, e.g. 'Listing!F1:J1'. |
| `dimension` | string |  | 'COLUMNS' or 'ROWS'. |

## Result

- { sheetId, grouped: true }

## Gotchas

- Only the relevant axis of the range is used, and it needs both ends: dimension='COLUMNS': 'Sheet1!C1:F1' or 'Sheet1!C:F' groups columns C-F. dimension='ROWS': 'Sheet1!A5:A20' or 'Sheet1!5:20' groups rows 5-20. 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. Groups can be nested (up to 8 levels). To nest, group a subset of an already-grouped range.

## Example

- group_sheet_rows_cols("1ABC...", "Listing!F1:J1", "COLUMNS")