Safely replace text
replace_textReplace a specific text block in an existing file using a SHA-256 concurrency guard. Verify the file's expected hash to prevent overwriting concurrent changes.
Instructions
Replace exactly one text block in an existing file using an expected SHA-256 concurrency guard.
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>",
"expectedSha256": "<expectedSha256>",
"oldText": "<oldText>",
"newText": "<newText>"
},
"name": "replace_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| newText | Yes | ||
| oldText | Yes | ||
| project | Yes | ||
| expectedSha256 | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| bytes | Yes | ||
| sha256 | Yes | ||
| project | Yes | ||
| replaced | Yes | ||
| previousSha256 | Yes |