find_replace_in_sheet

Find and replace text in a sheet.

destructiveGoogle Sheets, Docs & Drive

Call it

In an AI client (MCP)

tools/call
{
  "name": "find_replace_in_sheet",
  "arguments": {
    "spreadsheet_id": "<spreadsheet_id>",
    "find": "<find>",
    "replace": "<replace>"
  }
}

From code (Tool API)

curl -X POST https://api.sellersheetai.com/api/v1/tools/find_replace_in_sheet \
  -H "Authorization: Bearer $SELLERSHEET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"spreadsheet_id":"<spreadsheet_id>","find":"<find>","replace":"<replace>"}'
Early access — the Tool API is open on request, contact us.

Arguments

NameTypeDescription
spreadsheet_idrequiredstringthe spreadsheet ID (from its URL or get_sheet_metadata).
findrequiredstringText to find.
replacerequiredstringReplacement text.
sheet_namestringthe tab name. Omit it to search every tab.
match_casebooleanMatch case (default: False).Default: false
match_entirebooleanMatch entire cell (default: False).Default: false
regexbooleanUse regex (default: False).Default: false
include_formulasbooleanAlso search and replace inside formula strings (default: False). Use this to update IMPORTRANGE spreadsheet IDs in formula cells.Default: false

Result

Every tool answers {notification, data, human_action}; data carries:

  • data.occurrencesChanged — the number of replacements (0 = nothing matched).
  • data.valuesChanged / data.formulasChanged / data.rowsChanged / data.sheetsChanged — Google's per-kind counts.

Example

find_replace_in_sheet("1ABC...", "old", "new", "Sheet1", match_case=True)
find_replace_in_sheet("1ABC...", "oldSheetId", "newSheetId", include_formulas=True)

On this page

Actions

View as Markdown

Ask an assistant

Ask ChatGPTAsk Claude