format_gsheet
Unified Google Sheets formatting tool using discriminated spec.kind. Supported kinds: range_format, borders, freeze_panes, protect_range, validation, conditional_format, preset, list_presets. Examples: 1) Apply direct range styling: {“kind”:“range_format”,“sheet_id”:0,“start_row”:0,“end_row”:1,“start_col”:0,“end_col”:5,“bold”:true}. 2) Freeze headers: {“kind”:“freeze_panes”,“sheet_id”:0,“frozen_rows”:1}. 3) Apply preset styling: {“kind”:“preset”,“preset”:“financial_table”,“tab_name”:“Sheet1”}. Legacy calls with preset=... are still accepted but deprecated. Returns: spreadsheet_id (str | null) — target spreadsheet; operation / preset / detail (str | null) — formatting action summary; presets (list[dict] | null) — available presets when listing; sheet_url (str | null) — direct Google Sheets URL; error / message / hint (str | null) — soft-error details when formatting fails.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
project_name | str | Yes | — | |
preset | `str | None` | No | None |
tab_name | str | No | 'Sheet1' | |
spreadsheet_id | `str | None` | No | None |
source_name | `str | None` | No | None |
preset_params | `dict[str, Any] | None` | No | None |
spec | `FormatSpec | None` | No | None |
Returns
Section titled “Returns”Returns a structured object. Top-level fields:
spreadsheet_id(string)operation(string)preset(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": "format_gsheet", "arguments": { "project_name": "forecasts", "preset": "currency_usd", "tab_name": "Forecast", "spreadsheet_id": "1aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789ABCDEFG", "preset_params": { "start_row": 2, "end_row": 1000, "start_col": 2, "end_col": 3 } }}Response
Section titled “Response”{ "spreadsheet_id": "1aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789ABCDEFG", "operation": "preset_format", "preset": "currency_usd", "detail": "Applied currency_usd formatting to Forecast.", "sheet_url": "https://docs.google.com/spreadsheets/d/1aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789ABCDEFG/edit"}- Module:
Export to Sheets - Requires authentication via API token or Auth0 JWT.