ssh_apply_patch
Apply a unified diff to a remote SSH host, trying multiple patch strategies with support for dry-run and configurable strip levels to verify changes before committing them.
Instructions
Apply a unified diff on the remote host. Tries apply_patch (strip=0 only), then git apply, then patch. Supports dry-run and strip level.
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": {
"target": "<target>",
"patch": "<patch>"
},
"name": "ssh_apply_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| patch | Yes | Unified diff to apply. | |
| strip | No | Number of leading path components to strip (-p<N>). | |
| target | Yes | SSH target in the form user@host[:port]. Uses the local SSH config and keys. | |
| dry_run | No | Simulate the patch application without changing files. |