apply_patch
Apply a unified diff patch to files in a specified working directory, with options for backup creation and timeout management.
Instructions
Kali Agent MCP tool: apply_patch Explicit execution timing is supported. Before calling, deliberately choose expected_runtime_seconds, timeout_seconds, check_after_seconds, poll_interval_seconds, and on_timeout. Use on_timeout='continue_background' for long work that should return a durable job_id for later job_status/job_logs/job_wait checks; use 'kill' or 'return_partial' for bounded synchronous work.
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": {
"patch_text": "<patch_text>",
"cwd": "<cwd>"
},
"name": "apply_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | ||
| strip | No | ||
| check_only | No | ||
| on_timeout | No | return_partial | |
| patch_text | Yes | ||
| make_backup | No | ||
| timeout_seconds | No | ||
| check_after_seconds | No | ||
| poll_interval_seconds | No | ||
| expected_runtime_seconds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||