patch_file
Replace a file's contents in a Garry's Mod repository after backing it up, returning a patch ID and unified diff for restoration.
Instructions
Replaces a file's contents (inside the repo) after backing it up. Returns a patch id for restore_patch, plus the unified diff. rationale explains the change.
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>",
"content": "<content>",
"rationale": "<rationale>"
},
"name": "patch_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Path relative to the GMod repo. | |
| content | Yes | The file's complete new contents. | |
| rationale | Yes | Why this change is being made. |