insert event blocks
insert_event_blocksInsert event blocks at a chosen position—before/after a block or inside a branch—with revision checks and preview-first validation before committing.
Instructions
Insert blocks at a position (before/after a block id, or into a branch of a container). 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>",
"position": "<position>",
"blocks": "<blocks>"
},
"name": "insert_event_blocks"
}
}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. | |
| mapId | No | Map ID (map event page target) | |
| blocks | Yes | Event IR blocks (see resource rpgmz://docs/event-ir or get_event_ir_reference) | |
| eventId | No | Map event ID (map event page target) | |
| troopId | No | Troop ID (troop battle page target) | |
| position | Yes | Where to insert: {before:id} | {after:id} | {parentId, branch, index}. Inserting into the "else" branch of a conditional without one creates it. | |
| 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. |