Replace exact text safely in one file
replace_textReplace a specific text substring in a file, verified by SHA-256 hash and exact occurrence count, with automatic backup.
Instructions
Performs a precise text replacement with SHA-256 verification, exact occurrence counting, backup, and no shell or script execution.
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": {
"project": "<project>",
"path": "<path>",
"oldText": "<oldText>",
"newText": "<newText>",
"expectedSha256": "<expectedSha256>"
},
"name": "replace_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| newText | Yes | ||
| oldText | Yes | ||
| project | Yes | Project key from list_projects. | |
| expectedSha256 | Yes | ||
| expectedOccurrences | No |