write_gsheet
Consolidated Google Sheets write tool. Provide spec.mode to choose one operation: replace, append, clear, batch, or new_spreadsheet. Examples: 1) Replace model output in a target range: {“mode”:“replace”,“run_id”:”…”,“output_name”:“forecast.json”,“cell_range”:“Forecast!A1”}. 2) Append model output to a tab: {“mode”:“append”,“run_id”:”…”,“output_name”:“forecast.json”,“sheet_name”:“History”}.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
project_name | Annotated[str, Field(description='Name of the Bridge Town project.')] | Yes | — | |
spec | Annotated[WriteSpec, Field(description='Specification object describing the formatting/write/structure operation. See tool description for the schema.')] | Yes | — |
Returns
Section titled “Returns”Returns a structured object. Top-level fields:
spreadsheet_id(string)sheet_name(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": { "project_name": "forecasts", "spec": { "tab_name": "Forecast", "cell_range": "A1", "values": [ [ "Month", "Revenue" ], [ "2026-01", 100 ], [ "2026-02", 110 ] ], "value_input_option": "RAW", "spreadsheet_id": "1aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789ABCDEFG" } }}Response
Section titled “Response”{ "spreadsheet_id": "1aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789ABCDEFG", "sheet_name": "Forecast", "cell_range": "A1:B3", "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.