modify_gsheet_structure
Consolidated Google Sheets structure tool. Use spec.action as a discriminator: ensure_tab, insert_rows, or delete_rows. Examples: 1) Ensure a tab exists: {“action”:“ensure_tab”,“tab_title”:“Forecast”}. 2) Insert rows: {“action”:“insert_rows”,“sheet_id”:0,“start_row”:1,“num_rows”:3}. 3) Delete rows: {“action”:“delete_rows”,“sheet_id”:0,“start_row”:20,“num_rows”:5}. Returns: spreadsheet_id (str | null) — target spreadsheet; operation (str | null) — structure mutation performed; detail (str | null) — human-readable summary of the change; sheet_url (str | null) — direct Google Sheets URL; error / message / hint (str | null) — soft-error details when the operation fails.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
project_name | str | Yes | — | |
spec | StructureSpec | Yes | — |
Returns
Section titled “Returns”Returns a structured object. Top-level fields:
spreadsheet_id(string)operation(string)detail(string)sheet_url(string)
See the response example below for the full payload shape.
Example
Section titled “Example”Tool Call
Section titled “Tool Call”{ "name": "modify_gsheet_structure", "arguments": { "project_name": "forecasts", "spec": { "spreadsheet_id": "1aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789ABCDEFG", "operations": [ { "op": "add_sheet", "title": "Notes", "row_count": 1000, "column_count": 26 }, { "op": "rename_sheet", "sheet_id": 0, "new_title": "Forecast" } ] } }}Response
Section titled “Response”{ "spreadsheet_id": "1aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789ABCDEFG", "operation": "structure_mutation", "detail": "Applied 2 structure operations.", "sheet_url": "https://docs.google.com/spreadsheets/d/1aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789ABCDEFG/edit"}- Module:
Export to Sheets - Requires authentication via API token or Auth0 JWT.