ssh_patch_file
Replace a unique string in a remote file by reading, replacing locally, and writing back. Ensures the old string appears exactly once to avoid ambiguous edits.
Instructions
Replace a string in a file on the remote server.
Reads the file, performs the replacement locally, and writes it back. The old string must appear exactly once (to avoid ambiguous edits).
Args: path: Path to the file on the remote. old: The exact text to find and replace. Must be unique in the file. new: The replacement text. host: SSH host alias from config. Uses default if omitted.
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>",
"old": "<old>",
"new": "<new>"
},
"name": "ssh_patch_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| old | Yes | ||
| new | Yes | ||
| host | No |