Replace text in sandbox files
replace_in_filesReplace every occurrence of a plain-text pattern with a new value across specified sandbox files, or use an empty value to delete matches.
Instructions
Replace text in sandbox files. Replaces every occurrence of pattern with newValue in each file. Needs file.write.
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": {
"sandboxId": "<sandboxId>",
"paths": "<paths>",
"pattern": "<pattern>",
"newValue": "<newValue>"
},
"name": "replace_in_files"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes | Files up to 5 MiB each. | |
| pattern | Yes | Plain text. Every occurrence is replaced, byte for byte; the rest of the file is not changed. | |
| newValue | Yes | Required. Use "" to delete the matches. | |
| sandboxId | Yes | Public Sandbox id returned by create/list/get sandbox calls. |