Skip to content

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.

NameTypeRequiredDefaultDescription
project_namestrYes
preset`strNone`NoNone
tab_namestrNo'Sheet1'
spreadsheet_id`strNone`NoNone
source_name`strNone`NoNone
preset_params`dict[str, Any]None`NoNone
spec`FormatSpecNone`NoNone

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.

{
"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
}
}
}
{
"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.