get_sheet_data
Retrieve values or formatted grid data from a specific Google Sheets sheet, with optional A1 range and local-file output to handle large responses.
Instructions
Get data from a specific sheet in a Google Spreadsheet.
Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) sheet: The name of the sheet range: Optional cell range in A1 notation (e.g., 'A1:C10'). If not provided, gets all data. With include_grid_data=True and no range, the used range is auto-detected (see below) rather than fetching the sheet's full padded grid. include_grid_data: If True, includes cell formatting and other metadata in the response. Note: Setting this to True will significantly increase the response size and token usage when parsing the response, as it includes detailed cell formatting information — densely formatted cells serialize to hundreds of bytes each. If range is omitted, the actual used range is auto-detected first (one extra lightweight values-only request) and formatting is fetched only for that — sheets default to a padded 1000x26 grid regardless of actual content, and fetching per-cell formatting for the full padded grid instead of just your data can produce a response large enough to break the client connection. Default is False (returns values only, more efficient). Raises ValueError if the actual response size exceeds a safety cap (see MAX_TOOL_RESPONSE_CHARS in docs/configuration.md for the configured default — raise it to match a higher MAX_MCP_OUTPUT_TOKENS in your MCP client) and local_path is not set — narrow the range, retry, or pass local_path to bypass the cap entirely. local_path: Optional local filesystem path (file or directory) to write the result to instead of returning it inline. Bypasses the include_grid_data response-size cap. A path ending in '/' is a directory, created if missing. A file in place of a parent directory, or at a path ending in '/', raises ValueError; an existing file at a plain file path is replaced. Same caveat as download_file/download_folder: this path is resolved on the server's filesystem, not the caller's — over SSE that's only useful if the path is on a volume the caller can also reach; for stdio it's the same machine.
Returns: Grid data structure with either full metadata or just values from Google Sheets API, depending on include_grid_data parameter. If local_path is set, returns {local_path, spreadsheet_id, sheet, range, bytes_written} instead.
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>",
"sheet": "<sheet>"
},
"name": "get_sheet_data"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | No | ||
| sheet | Yes | ||
| local_path | No | ||
| spreadsheet_id | Yes | ||
| include_grid_data | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||