update_file
Find and replace text inside a file by providing the exact old and new strings, with control over replacing all occurrences or just the first.
Instructions
Find and replace text inside a file.
Use this when the user asks to change, replace, or update specific text within an existing file (e.g. "change X to Y in report.txt").
Args: path: Path to the file to modify. old_text: The exact existing text to search for. new_text: The text to replace it with. replace_all: If True (default), replace every occurrence. If False, replace only the first occurrence.
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": {
"path": "<path>",
"old_text": "<old_text>",
"new_text": "<new_text>"
},
"name": "update_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| new_text | Yes | ||
| old_text | Yes | ||
| replace_all | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |