Replace Text in Sandbox Files
sandbox_replace_contentsReplace text inside sandbox files in place and return per-file replacement counts to verify each edit. If counts are unavailable, read the file back to confirm changes.
Instructions
Replace text inside files, editing in place instead of rewriting the whole file. Returns a replaced_count per file — 0 means the old text was not found, so check it rather than assuming the edit landed. If detail_available is false the sandbox runtime is too old to report counts: the replacement still happened, but you have to read the file back to confirm what changed.
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": {
"sandbox_id": "<sandbox_id>",
"entries": "<entries>"
},
"name": "sandbox_replace_contents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entries | Yes | Replacements to apply | |
| sandbox_id | Yes | ID of the target sandbox |