Plain text · sha256 2eaaa8e08e0b
The description, line by line
5 lines Line numbers are v2.1.268 on the left and this capture on the right.
1
1
Performs exact string replacement in a file.
2
2
3
3
- You must Read the file in this conversation before editing, or the call will fail.
4
4
- `old_string` must match the file exactly, including indentation, and be unique — the edit fails otherwise. Strip the Read line prefix (line number + tab) before matching.
5
5
- `replace_all: true` replaces every occurrence instead.
What it accepts
4 parameters The JSON parameter schema sent beside this description, 654 characters of it. Name, type, then whether the client marked it required.file_path
string
required
The absolute path to the file to modify
new_string
string
required
The text to replace it with (must be different from old_string)
old_string
string
required
The text to replace
replace_all
boolean
optional
Replace all occurrences of old_string (default false)
sha256 9748c75edc64 · the schema as the client sent it:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"properties": {
"file_path": {
"description": "The absolute path to the file to modify",
"type": "string"
},
"new_string": {
"description": "The text to replace it with (must be different from old_string)",
"type": "string"
},
"old_string": {
"description": "The text to replace",
"type": "string"
},
"replace_all": {
"default": false,
"description": "Replace all occurrences of old_string (default false)",
"type": "boolean"
}
},
"required": [
"file_path",
"old_string",
"new_string"
],
"type": "object"
}