remote_replace
Replace an exact string in a remote file without transferring the whole file. The old string must match uniquely to prevent edits in the wrong place.
Instructions
在远端文件里做精确字符串替换,无需传整个文件。old_string 必须唯一匹配,否则报错——这是为了防止改错地方。
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": {
"path": "<path>",
"oldString": "<oldString>",
"newString": "<newString>"
},
"name": "remote_replace"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | 文件路径 | |
| newString | Yes | 替换后的内容 | |
| oldString | Yes | 要被替换的原始片段,需精确匹配(含缩进) | |
| replaceAll | No | 是否替换全部匹配,默认 false(要求唯一匹配) |