Applypatch
applyPatchApply a unified diff to one existing local file with GNU patch, using a configurable strip level and restricted options.
Instructions
Apply diff from stdin to one explicit local file using GNU patch.
pnum is GNU patch's -pNUM value. The target must be an existing
regular file beneath the configured current directory. Additional options
are restricted to a small allowlist that cannot select input/output files,
another target, a directory, or a different strip value.
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": {
"file": "<file>",
"diff": "<diff>"
},
"name": "applyPatch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | ||
| diff | Yes | ||
| file | Yes | ||
| pnum | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |