edit_vmf
Edits a .vmf in place by splicing byte ranges, preserving untouched bytes, and adds, updates, or removes entities and outputs without reserializing the file.
Instructions
Edits a .vmf in place by splicing byte ranges of the original file: everything not touched stays byte-identical, so a one-entity change is a one-entity diff. Adds, updates and removes entities, and adds or removes their outputs. Never reserialises the file: comments, blank lines and hand-written indentation would be lost silently. Does not create brush geometry -- that is write_vmf_solid, which has the checks that job needs. Run read_vmf_lint after editing.
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": {
"path": "<path>",
"ops": "<ops>"
},
"name": "edit_vmf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ops | Yes | ||
| path | Yes | Path to the .vmf, absolute or relative to the repo root. | |
| backup | No | Copy the file to <file>.bak before writing. Nothing is copied on a no-op. | |
| dryRun | No | Check and report without writing. Every verification runs either way. | |
| confirm | No | Required (true) to run this tool: it writes or executes. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | Yes | ||
| path | Yes | ||
| dryRun | Yes | ||
| written | Yes | ||
| outcomes | Yes | ||
| warnings | Yes | ||
| unchanged | Yes | True when the ops produced the exact same bytes. Nothing is written then. | |
| backupPath | Yes | ||
| bytesAfter | Yes | ||
| bytesBefore | Yes | ||
| entitiesAfter | Yes | ||
| entitiesBefore | Yes |