apply_code_patch
Applies validated Python code changes to a target file while enforcing Git safety gates and automatically rolling back invalid syntax modifications.
Instructions
Safely modifies a target Python source file after validating AST syntax and establishing Git safety gates. Automatically rolls back on invalid syntax.
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_path": "<file_path>",
"new_content": "<new_content>"
},
"name": "apply_code_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Target source file path to modify. | |
| new_content | Yes | Full updated source code content to apply. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |