replace event logic
replace_event_logicReplace a command list's complete logic with new IR or block arrays, previewing semantic and native diffs plus validation before applying. Requires the list revision to reject stale edits.
Instructions
Replace the complete logic of a list with new IR ({irVersion:1, blocks} or a block array). Prefer minimal edits unless a rewrite was requested. Keep raw_command blocks you received to preserve unsupported commands. Requires the list revision.
Preview-first: returns a change set (semantic + native diff, validation). Pass apply=true to commit immediately when the preview is clean.
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": {
"revision": "<revision>",
"logic": "<logic>"
},
"name": "replace_event_logic"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apply | No | Commit right after a successful preview (non-destructive operations only; needs --allow-write; warnings also need acknowledgeWarnings). Default false = preview only. | |
| logic | Yes | ||
| mapId | No | Map ID (map event page target) | |
| eventId | No | Map event ID (map event page target) | |
| troopId | No | Troop ID (troop battle page target) | |
| revision | Yes | Revision token of the command list from get_event_logic / get_event_page (rejects stale block ids) | |
| pageIndex | No | ZERO-based page index (map event or troop page) | |
| allowScript | No | true ONLY if the user explicitly asked to insert JavaScript (script commands, script conditions/operands, route scripts). | |
| description | No | Optional description stored in the transaction log | |
| commonEventId | No | Common event ID (common event target) | |
| acknowledgeWarnings | No | Accept validation warnings when apply=true. Review them with the user first. |