find_replace
Replace text in Excel worksheets by specifying find and replacement strings, with support for regex, case matching, whole-cell matches, and formula search.
Instructions
Find and replace text across a worksheet.
Args: file_path: Path to workbook to modify. sheet_name: Worksheet name. find_text: Substring or pattern to find. replace_text: Replacement text. match_case: Case-sensitive search when True. match_entire_cell: Match entire cell contents exactly when True. search_formulas: Also search within formulas when True. regex: Treat find_text as a regular expression when True.
Returns: dict: {"count": int, "cells": ["A1", ...]} detailing replacements.
Notes: - Destructive: modifies cells in-place. - Consider returning per-cell before/after pairs for audit logging in high-risk contexts.
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": {
"file_path": "<file_path>",
"sheet_name": "<sheet_name>",
"find_text": "<find_text>",
"replace_text": "<replace_text>"
},
"name": "find_replace"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| regex | No | ||
| file_path | Yes | ||
| find_text | Yes | ||
| match_case | No | ||
| sheet_name | Yes | ||
| replace_text | Yes | ||
| search_formulas | No | ||
| match_entire_cell | No |