Skip to main content
Glama
okenjioxx

Roblox Executor MCP Server

by okenjioxx

Run a Luau snippet with a watchdog timeout

run-with-timeout
Destructive

Execute a Luau snippet under a watchdog timeout so code that hangs on a yield returns timedOut instead of blocking the call forever.

Instructions

Run a Luau snippet under a WATCHDOG: it executes on its own thread and this tool polls a done flag against an os.clock() deadline, so a snippet that hangs on a YIELD (a yield that never resumes, a :Wait() on a signal that never fires) cannot block the round trip forever — after timeoutSec you get a clean { timedOut = true } instead of waiting out the whole connector timeout. Use this any time you are about to run code that MIGHT hang or take an unknown amount of time. The snippet is COMPILED FIRST via loadstring (a syntax error returns { error } and nothing runs), then started with task.spawn; the watchdog waits with task.wait until either the thread sets its done flag or the deadline passes. LIMITATION: Luau is cooperatively scheduled, so the watchdog can only fire when the snippet YIELDS. A snippet that never yields (e.g. while true do end or a tight CPU loop with no task.wait) runs synchronously inside task.spawn, so the watchdog loop never gets to run and the round trip still blocks until the connector timeout. Put a task.wait() inside long loops if you want the watchdog to be able to interrupt them. IMPORTANT: a timeout REPORTS that the snippet did not finish in time, but it does NOT kill the runaway thread — the executor keeps running it in the background (and it may keep consuming CPU). Prefer snippets that can finish, and keep timeoutSec sane. If the snippet completes in time, its FIRST return value is encoded via __encVal and returned; a runtime error inside it is captured in error. Requires loadstring, the task library, and os.clock (all guarded). Returns { completed, timedOut, elapsedMs, result?, error? } or { error }. Signature: { code: string, timeoutSec: any?, threadContext: number? }. Phase: act; cost=medium; idempotency=contextual-write. Requires: active-client, explicit-mutation-approval, validated-source. 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

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe Luau snippet to run under the watchdog. Compiled with loadstring and run on its own thread. To report a value back, `return` it (only the first return value is captured, encoded as a serializable scalar/string).
timeoutSecNoHow long to let the snippet run before giving up and reporting timedOut, in seconds (default 5, clamped 0.1..60). On timeout the snippet is NOT killed — it keeps running in the background; this only stops THIS tool from waiting.
threadContextNoOptional Roblox thread identity for this call; omit it to use the server default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0-spies.2

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Far exceeds the annotations: discloses the cooperative-scheduling limitation (watchdog only fires on yield), that a timeout does NOT kill the runaway thread, that compile happens first via loadstring, and that only the first return value is encoded. These are exactly the behavioral traits an agent needs beyond destructiveHint=false/idempotentHint=false.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core behavior, but very long and repetitive — the 'timeout does not kill the snippet' caveat is stated twice, and ALL-CAPS emphasis plus the signature/phase/safety trailer add length without new information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description compensates fully by spelling out both return shapes ({ completed, timedOut, elapsedMs, result?, error? } and { error }) and the runtime-error capture behavior. Complete for a mutating, high-complexity tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds some timeout semantics, but largely repeats the signature and the schema's own notes (timeout clamps, thread not killed); it does not add new meaning for threadContext.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('run a Luau snippet under a WATCHDOG') plus the exact mechanism (own thread, polled done flag vs os.clock() deadline). This clearly separates it from siblings like execute, run-luau, and execute-and-wait, which lack the timeout watchdog.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says when to use it: 'any time you are about to run code that MIGHT hang or take an unknown amount of time,' and explains the failure mode it prevents. It does not name the alternative siblings (execute-and-wait, run-luau) or when to prefer them instead, so it stops short of full routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools