run_playtest
Play the game headless from a script of steps to verify runtime behavior validators cannot check: doors, NPC dialogue, choice branches, invisible walls, or battle outcomes.
Instructions
Play the game headless from a script of steps and report what happened — the runtime check validators cannot do (does the door transfer, does the NPC say the right thing, does the choice branch, is there an invisible wall). One browser session runs the whole script; each step reports its outcome and the run stops at the first failing step. Steps: load {mapId,x,y,direction?,party?,level?,gold?,switches?,variables?,selfSwitches?,items?,equip?,encounters?} starts a fresh game there (random encounters off unless encounters:true); startEvent {eventId} starts a map event as if triggered and lets it run until it shows text or goes idle (waiting out any transfer — reported as transferredTo); advanceText {maxMs?} presses OK until the event is idle, STOPPING at an open choice list/battle — returns the map message lines shown and any open choices (text shown during a battle comes back separately as battleLines); choose {index} picks a 0-based choice; walk {direction, steps?} walks tile by tile, reporting where it ended (to); if a tile refused entry, stoppedAt (the player's tile) and blockedTile (the refused one); when a step fires a touch event (a door) it stops, waits out the transfer and reports transferredTo {mapId,x,y}, plus eventRunning/messageOpen if the event is still going; press {button, times?}; wait {ms}; autoBattle {troopId?, canEscape?, canLose?, maxMs? (default 60000)} fights (a started or new battle) on auto AI until it ends, returning the battle's message lines (troop events, victory text). Battles are fast-forwarded (20 engine frames per drawn frame: same logic, same odds, a 10-turn boss fight in seconds) unless the run sets realtime: true; screenshot {name?} saves a PNG; eval {script} evaluates a JS expression in the game page and returns its value (e.g. "$gameSwitches.value(3)"). Reported text reads as the message window shows it: \V[n]/\N[n]/\P[n]/\G expanded, control codes (\C[n], \I[n], ., | …) removed. Every step result carries ok; the response ends with finalState (scene, map, position, gold, party) and problems (console/page errors, HTTP 404s). Max 200 steps. Read-only: never writes the project. A run can take MINUTES (booting ~5-10 s, long cutscenes, realtime battles): clients should raise their request timeout, or send a progressToken with resetTimeoutOnProgress — the tool then sends a progress notification per step and every 5 s during long ones. Split long scripts into several runs if your client can do neither. Needs the optional dependency playwright-core and a Chromium from the Playwright cache (npx playwright install chromium-headless-shell) or the RPGMAKER_MCP_CHROMIUM env var.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | No | Directory for screenshot PNGs. Default: <os tmpdir>/rpgmaker-mz-mcp/renders. | |
| steps | Yes | The script, run in order. | |
| inline | No | Also return the PNG(s) as image content in the response (default false: paths only — read the file to view it). | |
| realtime | No | Play battles at real-time speed (default false: battles are fast-forwarded). Real time takes ~10-20x longer — raise autoBattle maxMs to match. |