write_gsheet
Consolidated Google Sheets write tool. Provide spec.mode to choose one operation: replace, append, clear, batch, or new_spreadsheet. replace writes a rectangular grid at cell_range, adding a generated header row for tabular shapes ({columns, rows} or list[dict]); cell_range is a top-left anchor, not an exact one-cell target, so a single cell such as “Forecast!B66” still gets overwritten across the full grid the output expands into.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model_name | Annotated[str, Field(description='Name of the Bridge Town model.')] | Yes | — | |
spec | Annotated[WriteSpec, Field(description='Specification object describing the formatting/write/structure operation. See tool description for the schema.')] | Yes | — | |
workspace_id | `Annotated[str | None, Field(description=WORKSPACE_ID_FIELD_DESCRIPTION)]` | No | None |
Returns
Section titled “Returns”Returns a structured object. Top-level fields:
spreadsheet_id(string)cell_range(string)rows_written(integer)mode(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": "write_gsheet", "arguments": { "model_name": "forecasts", "spec": { "mode": "replace", "run_id": "66666666-6666-6666-6666-666666666666", "output_name": "forecast.json", "cell_range": "Forecast!B2:C4", "spreadsheet_id": "1aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789ABCDEFG" } }}Response
Section titled “Response”{ "spreadsheet_id": "1aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789ABCDEFG", "cell_range": "Forecast!B2:C4", "rows_written": 3, "mode": "replace", "sheet_url": "https://docs.google.com/spreadsheets/d/1aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789ABCDEFG/edit"}- Module:
Export to Sheets - Requires authentication via API token or Auth0 JWT.