Manage sheets
manage_sheetsAdd, duplicate, rename, delete, or copy spreadsheet tabs to manage sheet organization within Google Sheets.
Instructions
Manages the sheets (tabs) of a spreadsheet. action=add creates a tab (title required; optional index position and row_count/column_count — default 1000×26). action=duplicate copies a tab within the same spreadsheet (sheet_id; optional title for the copy and index). action=rename changes a tab's title (sheet_id + title; the numeric sheetId never changes, so other tools keep working). action=delete removes the tab AND all its data — irreversible through the API, and deleting the last remaining sheet fails. action=copy_to copies a tab into ANOTHER spreadsheet (sheet_id + destination_spreadsheet_id; the copy arrives named "Copy of ..." — rename it there). Get sheet_id values from get_spreadsheet; every action except add returns batchUpdate replies with the affected sheet's properties.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | No | add/duplicate: 0-based tab position for the new sheet (omit = after the existing tabs). | |
| title | No | add: the new tab's title (required). rename: the new title (required). duplicate: the copy's title. | |
| action | Yes | What to do with the sheets. | |
| sheet_id | No | duplicate/rename/delete/copy_to: the target sheet. | |
| row_count | No | add: grid rows for the new sheet (default 1000). | |
| column_count | No | add: grid columns for the new sheet (default 26). | |
| 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. | |
| destination_spreadsheet_id | No | copy_to: the spreadsheet to copy the sheet into. |