github_mcp.apply_patch
Replace an exact, uniquely occurring UTF-8 text fragment in a planned job file using a supplied checksum; rejects missing or ambiguous context instead of fuzzy matching.
Instructions
Replace an exact, uniquely occurring UTF-8 text fragment in a planned job file. Read the file first and supply its checksum. Rejects missing or ambiguous context instead of fuzzy matching. Returns path, new checksum and byte count; invalidates preview and checks without committing.
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": {
"job_id": "<job_id>",
"path": "<path>",
"old_text": "<old_text>",
"new_text": "<new_text>",
"expected_checksum": "<expected_checksum>"
},
"name": "github_mcp.apply_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Planned repository-relative file path. | |
| job_id | Yes | Existing editable job identifier. | |
| new_text | Yes | Replacement text; may be empty to remove the fragment. | |
| old_text | Yes | Nonempty exact text that occurs once in the current file. | |
| expected_checksum | Yes | Current SHA-256 checksum from read_file for this job workspace. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | ||
| message | No | ||
| error_code | No |