Run many Luau snippets in order in one call
batch-executeRun several independent Luau snippets in one round trip, collecting each result and isolating per-snippet compile or runtime errors so one failure never aborts the rest.
Instructions
Run several independent Luau snippets in sequence in a single round trip, collecting every result without paying a separate tool call per snippet. Each snippet is COMPILED with loadstring and run under its own pcall, in input order; a compile or runtime error in one snippet is recorded for that snippet only and never aborts the others. For each snippet you get { index, ok, value? , error? } — value is the FIRST return value, encoded so Instances/Vector3/etc. survive serialization; error carries the compile or runtime message when ok is false. Use this to read several instances, probe multiple remotes, or run a short script of steps in one shot. Requires loadstring (guarded). Returns { results = [{ index, ok, value?, error? }] } in input order. Signature: { snippets: {string}, client: string?, agent: string?, threadContext: number?, timeoutMs: number? }. Phase: orchestrate; cost=medium; idempotency=contextual-write. Requires: active-client, explicit-mutation-approval. Produces: operation-receipt. Verify with: assert-state. Safety: MUTATING; executes caller-selected behavior in the live client. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent | No | Optional. A stable label for WHICH agent is calling when several share this MCP session (e.g. 'researcher'). Gives that agent its own fair scheduling lane, its own persistent VM on each game, and its own queue budget, so co-tenant agents don't starve or clobber each other. | |
| client | No | Optional. Run on a specific connected client — its clientId OR username — for THIS call only, overriding your session's select-client binding without changing it. Lets multiple agents drive different games at the same time; omit to use your session's selected client. | |
| snippets | Yes | The Luau snippets to run, in order. Each is compiled and pcall-guarded independently; to capture a value, `return` it (only the first return value is collected). | |
| timeoutMs | No | Optional per-call deadline in milliseconds; omit it to use the tool or server default. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |