write_draft
Overwrite an existing draft Lua file of a War Selection mod (latest version by default) while backing up the previous content. Use after editing the draft in the game's developer mode.
Instructions
WRITE: overwrite the existing draft modsStorage/draft/_-.lua of a mod (latest draft version by default). The game creates that file when the mod script is opened with 'edit script' in developer mode; this tool never creates files and never touches published files in modsStorage. The previous content is backed up to the user data folder (draft-backups). Save/apply in the game.
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": {
"mod_id": "<mod_id>",
"code": "<code>"
},
"name": "write_draft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| mod_id | Yes | ||
| version | No | ||
| extension | No | .lua |