sheets_spreadsheet
An existing spreadsheet: its cells (describe, read, write, clear), its tabs and rows, and their formatting.
op:
"metadata" (default): get a spreadsheet's metadata: title + the sheets/tabs it contains (id, title, rows, cols).
"read": read values from a range (A1 notation, e.g. 'Sheet1!A1:D20' or 'A:ZZ').
rangeomitted = 'A:ZZ'. Returns {rows: [[...], ...], count}."write": write a 2-D array of values to a range (A1 notation required).
append: False (default) OVERWRITES the range ; True appends rows after the existing data (no overwrite), starting at the range's FIRST column. Instead ofvalues,sourcewrites a CSV oto fetches itself (e.g.{"kind": "http", "path": "/export.csv"}through yourhttpconnector): the values never go through you. A strict number goes as a number, a cell starting with'stays text as is (long ids), a cell that would be a formula is written as text unlessallow_formulas=True."clear": clear all values in a range (keeps formatting). Destructive —
rangeis required, it has no default here."add_sheet" (
title,index) ; "rename_sheet" (sheet→title)."delete_sheet" (the tab and EVERYTHING in it) and "delete_rows" (
start_row..end_row, 1-based inclusive): irreversible, so dry-run by default — the call says what would go ;dry_run=falsedoes it."number_format":
pattern(#,##0.00,0.0%,dd/mm/yyyy) andtypeapplied to every cell ofrange(e.g.'P&L'!B2:D)."copy_sheet": copy the tab
sheetof this spreadsheet — values AND formatting (widths, frozen rows, colours, drop-downs, conditional formats) — intoto_spreadsheet_id(this spreadsheet if omitted), namedtitle, atindex. The source is only read: copy a user's template tab into the file you produce, then write your data into the copy, to get their exact layout."format":
styleapplied to every cell ofrange; only the keys given change —background/color(#rrggbb),bold,italic,font_size,wrap(true = wrap text),align(left|center|right),valign(top|middle|bottom). E.g. a grey wrapped header:range="'Suivi'!A1:Z1",style={"background": "#d9d9d9", "bold": true, "wrap": true}."column_width":
widthin pixels for the columns ofrange('Suivi'!B:D)."freeze": freeze the first
frozen_rowsrows and/orfrozen_colscolumns ofsheet(0 unfreezes)."dropdown": a drop-down list of
optionson every cell ofrange, other values rejected ;options=[]removes it. An unknown tab is refused, naming the existing ones.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"spreadsheet_id": "<spreadsheet_id>"
},
"name": "sheets_spreadsheet"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | No | the verb, listed above ; metadata (default). | metadata |
| _org | No | Org (id) de CET APPEL. `oto_list_orgs()`. | |
| type | No | op="number_format" — NUMBER (default) | CURRENCY | PERCENT | DATE | TIME | DATE_TIME | SCIENTIFIC | TEXT. | NUMBER |
| index | No | op="add_sheet"/"copy_sheet" — 0-based position of the new tab (end by default). | |
| range | No | A1 notation, e.g. 'Sheet1!A1:D20' or 'A:ZZ'. op="read" — optional ('A:ZZ' if omitted) ; op="write"/"clear"/"number_format"/"format"/ "column_width"/"dropdown" — REQUIRED. | |
| sheet | No | op="rename_sheet"/"delete_sheet"/"delete_rows"/"copy_sheet"/ "freeze" — the tab, by title or numeric id. | |
| style | No | op="format" — the cell style, keys as listed above. | |
| title | No | op="add_sheet" — the new tab's title ; op="rename_sheet" — the new title ; op="copy_sheet" — the copy's title (Google's `Copy of …` if omitted). | |
| width | No | op="column_width" — pixels. | |
| _group | No | Équipe (id) de CET APPEL, sous son org parente. | |
| append | No | op="write" — False (default) OVERWRITES the range ; True appends rows after the existing data (no overwrite), from the range's first column. | |
| source | No | op="write" — a CSV fetched server-side instead of `values`: `{"kind": "http", "path": "/…", "params": {…}}` (GET through your `http` connector, auth injected), or any file reference (drive, url, project_file). UTF-8, comma, RFC 4180 quotes. | |
| values | No | op="write" — the 2-D array of values to write. Exclusive with `source`. | |
| _run_id | No | OBLIGATOIRE à chaque appel dès `run_start` ou `data_claim_next` : sans lui, l'écriture sur une ligne réservée est refusée. Hérité seulement si le serveur tient un run actif — n'y compte pas. | |
| account | No | Google account (email) to act as — same choice as `_account`. | |
| dry_run | No | op="delete_sheet"/"delete_rows" — True (default) only says what would be deleted ; False deletes. | |
| end_row | No | op="delete_rows" — last row to delete, inclusive. | |
| options | No | op="dropdown" — the choices of the list ; [] removes it. | |
| pattern | No | op="number_format" — the format pattern, as in the sheet UI. | |
| _account | No | Compte à OPÉRER quand plusieurs existent. `oto_identity(op='list')`. | |
| _project | No | Projet (id) de CET APPEL — jeton PRIMAIRE. `oto_project(op='list')`. | |
| _instance | No | Instance de connecteur PRÉCISE (un credential exact). `oto_instance(op='list')`. | |
| formatted | No | op="read" — True = display strings (FORMATTED_VALUE) ; False = raw values. | |
| start_row | No | op="delete_rows" — first row to delete (1-based, as displayed). | |
| frozen_cols | No | op="freeze" — columns frozen at the left (0 = none). | |
| frozen_rows | No | op="freeze" — rows frozen at the top (0 = none). | |
| allow_formulas | No | op="write" with `source` — False (default) writes a cell starting with = + - @ as TEXT (a third party's CSV cannot plant a formula in your sheet) ; True lets formulas through. | |
| spreadsheet_id | Yes | the spreadsheet to act on (every op). | |
| to_spreadsheet_id | No | op="copy_sheet" — the spreadsheet receiving the copy (this one if omitted). |