scenario

Runs a list of steps in one call and returns a transcript. Steps can call tools, wait for events, pause, and check answers, so a whole test step fits in one call: order an attack, wait for the turn to end, check the target’s health.

A wait starts from the cursor taken just before the latest tool step, so it does not miss what that tool set off. The run stops at the first failed step unless continueOnError is true. It takes at most 100 steps and runs within budgetMs: waits and sleeps are cut to the time left, and the run stops with timedOut when it is gone. A tool step already running in the game is always waited for to its end, because what it does cannot be undone.

The answer includes ok, timedOut, stepsRun, elapsedMs, and steps, one entry per step run.

A call may take up to budgetMs milliseconds, 600000 by default.

Arguments

Name Type Required What
steps array yes The steps, 1 to 100, each one of: - {“tool”: name, “args”: {…}, “as”: label}: call a tool. - {“waitFor”: {“topic”: …, “match”: {…}}, “timeoutMs”: n, “since”: cursor, “as”: label}: wait for an event, like wait_for. - {“sleepMs”: n}: pause, at most 60000 ms. - {“expect”: {“from”: label, “pointer”: “/given”, “equals” | “notEquals” | “exists” | “atLeast” | “atMost”: value}}: check the answer of an earlier step labeled with as. - {“until”: {“tool”, “args”, “pointer”, an expectation, “intervalMs”}, “timeoutMs”: n, “as”: label}: call a tool until a condition holds, like wait_until. A step’s timeoutMs defaults to 30000.
continueOnError boolean   If true, keep going past a failed step. Default false.
budgetMs integer (≥ 1, ≤ 600000)   The longest the whole run may take, in milliseconds. Default and maximum 600000 (ten minutes).

Call it as scenario over MCP, or POST /api/tool/scenario with the arguments as JSON.