Manage rows and columns
manage_dimensionsResize, insert, delete, hide/show, or group rows and columns in Google Sheets by specifying a contiguous range and action.
Instructions
Row/column operations on a run of rows (dimension=ROWS) or columns (dimension=COLUMNS), addressed by sheet_id + 0-based start_index (inclusive) and end_index (exclusive) — e.g. columns A-C = start 0, end 3. action=resize sets an exact pixel_size; auto_resize fits to content; insert adds empty rows/columns at start_index (inherit_from_before=true copies formatting from the row/column before instead of after); delete removes them WITH their data (irreversible; cell references below/right shift); hide/show toggle visibility without touching data; group/ungroup add or remove a collapsible outline group over the run (groups nest — repeat group on a subrange for a deeper level).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | What to do with the rows/columns. | |
| sheet_id | Yes | The numeric sheetId (NOT the title) from get_spreadsheet sheets[].properties.sheetId; the first sheet of a new spreadsheet is 0. | |
| dimension | Yes | Whether the run is rows or columns. | |
| end_index | Yes | End of the run, exclusive (rows 1-3 = start 0, end 3). | |
| pixel_size | No | resize: the new size in pixels. | |
| start_index | Yes | First row/column of the run, 0-based inclusive. | |
| spreadsheet_id | Yes | The spreadsheet id — the long id from the URL (docs.google.com/spreadsheets/d/<spreadsheetId>/edit) or from create_spreadsheet / search_spreadsheets output. | |
| inherit_from_before | No | insert: new rows/columns copy formatting from before the insertion point (default: after). |