Skip to main content
Sheetbase Docs
Tools

Tools Overview

21 tools. Exact names, descriptions, and design principles.

Sheetbase exposes 21 tools across five categories. Every tool name, description, and parameter in this documentation is sourced from the registered Zod tool schemas.


Tool surface

ToolCategoryDescription
list_spreadsheetsReadList all spreadsheets in Drive
list_sheetsReadList tabs in a spreadsheet
inspect_spreadsheetReadRead-only spreadsheet recon: tab architecture, header/formula signals, type guesses, and risks
read_rangeReadRead a range — returns values + _schema
search_rowsReadFast server-side exact match search within a column
write_rangeWriteWrite a 2D array to a specific range
append_rowsWriteAppend rows to the bottom of an existing table
clear_rangeWriteClear values in a range (keeps formatting)
format_cellsWriteApply visual formatting using zero-based grid indexes
analyze_rangeSQLExecute Postgres SQL on a range — read-only
transform_rangeSQLRead → SQL transform → write back in-place
create_spreadsheetManageCreate a new blank spreadsheet
manage_sheetsManageAdd, rename, or delete tabs via the REST API
insert_columnManageInsert a blank column before/after a safe ColumnRef target
move_columnManageMove a column before another column with formula/protection guards
delete_columnManagePermanently delete a column with confirmation and formula/protection guards
delete_rowsManagePermanently delete rows with semantic targeting and preview confirmation
copy_sheetManageCopy a tab to another spreadsheet
batch_update_sheetManageStructural updates: charts, merges, formatting
restore_snapshotManageList and restore pre-write snapshots
manage_driveDriveSearch Drive files, convert to Spreadsheets

Design principles

1. Fail-closed writes

All write tools (write_range, append_rows, transform_range) block by default if the target range contains formulas, overlaps a strict Protected Range, or intersects structured note guards such as [WARN], [FORMULA], or [LOCK]. Agents must pass the specific override (allowFormulaOverwrite or allowNoteGuardOverride) only after confirming the write is intentional.

2. AX over raw data transfer

analyze_range and transform_range exist specifically to keep raw tabular data out of the agent context window. An agent should never read_range on a large dataset just to compute a sum — that's what analyze_range is for.

3. Schema always co-delivered

read_range returns _schema alongside values in every response. analyze_range returns _schema alongside query results. Agents have structural sheet information without a separate tool call.

4. Recon before mutation

Use inspect_spreadsheet before broad transformations or destructive edits on an unfamiliar workbook. It returns a bounded, read-only architecture map so agents can identify likely transaction, reference, dashboard, calculation, and config tabs before choosing target ranges.

5. Destructive row deletes require preview

Use delete_rows for row deletion. It resolves 1-based rows, A1 ranges, or exact column matches, then returns a preview token before any delete occurs. Confirmation rechecks the row set and row-content fingerprint before calling the Sheets API.

6. Undo is available for value writes

Every write_range and transform_range call saves a before_values snapshot to write_history (≤ 1,000 rows). restore_snapshot can list and apply these snapshots. Row deletes store audit-only history and cannot be restored automatically.

7. Structural edits use focused tools first

Use insert_column, move_column, and delete_column for common column structure changes. They resolve human-friendly ColumnRefs, block ambiguous headers, and preflight formula/protected-range risks before calling the Sheets API.

8. 41% schema token savings (v1.1.0)

The Zod tool schemas were aggressively trimmed in v1.1.0 — removing redundant z.describe() attributes on self-evident fields. Total schema context load dropped from ~760 tokens to ~450 tokens per tool call. This directly increases agent reasoning budget per invocation.


MCP tool call anatomy

Every tool response uses the standard MCP content envelope:

{
  "content": [{
    "type": "text",
    "text": "{ ... JSON result ... }"
  }]
}

Errors add "isError": true and may include "needsAuth": true for expired OAuth sessions. See the Error Reference for the full error catalogue.


AX tool selection guide

SituationRight toolWrong tool
Need to see what spreadsheets existlist_spreadsheets
Need tab names + numeric IDslist_sheets
Need to understand an unfamiliar workbook before editsinspect_spreadsheetad hoc full-sheet reads
Preview sheet structure + small dataread_range
Aggregate 500+ rowsanalyze_rangeread_range
Reformat/enrich data in-placetransform_rangeread_range → LLM → write_range
Add rows without overwritingappend_rowswrite_range
Undo a writerestore_snapshotRewriting manually
Find a file in Drivemanage_drive searchlist_spreadsheets (won't find CSVs)
Convert uploaded CSV to Sheetsmanage_drive convert
Insert/move/delete columns safelyinsert_column / move_column / delete_columnraw batch_update_sheet JSON
Delete rows safelydelete_rowsraw batch_update_sheet row indexes
Apply chart/merge/validationbatch_update_sheet

On this page