sheets-mcp docs
Tools

Tools Overview

14 tools. Exact names, descriptions, and design principles. Source: route.ts.

sheets-mcp exposes 14 tools across five categories. Every tool name, description, and parameter in this documentation is sourced directly from the Zod schemas in route.ts.


Tool surface

ToolCategoryDescription
list_spreadsheetsReadList all spreadsheets in Drive
list_sheetsReadList tabs in a spreadsheet
read_rangeReadRead a range — returns values + _schema
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
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 or overlaps a strict Protected Range. Agents must pass allowFormulaOverwrite: true to explicitly override. This is intentional — it prevents agents from silently destroying formulas.

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. Undo is always available

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.

5. 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
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
Apply chart/merge/validationbatch_update_sheet

On this page