find_in_spreadsheet
Search cells in a Google Spreadsheet for a specific value and return matches with sheet and A1 location; optionally limit results or write output to a server-side file.
Instructions
Find cells containing a specific value in a Google Spreadsheet.
Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) query: The text to search for in cell values sheet: Optional sheet name to search in. If not provided, searches all sheets. case_sensitive: Whether the search should be case-sensitive (default False) max_results: Maximum number of results to return (default 50) local_path: Optional local filesystem path (file or directory) to write the result to instead of returning it inline. Bypasses the 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.
Returns: List of found cells with their location (sheet, cell in A1 notation) and value. max_results bounds match count, not response size — matched cell values can still be large. Raises ValueError if the response exceeds a safety cap (see MAX_TOOL_RESPONSE_CHARS in docs/configuration.md for the configured default) and local_path is not set — lower max_results, or pass local_path. If local_path is set, returns {local_path, spreadsheet_id, query, match_count, 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>",
"query": "<query>"
},
"name": "find_in_spreadsheet"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| sheet | No | ||
| local_path | No | ||
| max_results | No | ||
| case_sensitive | No | ||
| spreadsheet_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |