Skip to main content
Glama

Run Lua in Roblox

execute_lua
Destructive

Run Lua code inside a connected Roblox executor and get back serialized return values or error tracebacks. Optionally capture console logs and script errors produced during the run.

Instructions

Run Lua code inside the connected Roblox executor. Returns the serialized return values, or the error with a traceback. Set capture_logs to also get the console lines and script errors that appeared while it ran. Use timeout_ms for code that takes long. The code runs with the executor's full permissions, so only run code the user asked for. Requires the connected state.

Input Schema

NameRequiredDescriptionDefault
codeYesLua source code to run. Use 'return' to get a value back.
clientNoClient id from list_clients, for example c2. Defaults to the client that connected last.
wait_msNoWith capture_logs: how long to keep collecting after the code finished (default 500).
timeout_msNoHow long to wait for the code to finish (default 15000).
capture_logsNoAlso return the console lines and script errors produced during the run (default false).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the annotations it discloses the return contract (serialized return values or an error with traceback), the side-channel behavior of capture_logs, and the critical security fact that code runs with the executor's full permissions plus a connected-state prerequisite. That materially exceeds what destructiveHint=true conveys. The one gap is that it does not characterize how much damage a given call can do or whether output is truncated for large results.

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

Conciseness4/5

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

Five short sentences, front-loaded with what the tool does and what it returns before moving to optional flags and safety. Every sentence carries information, though the timeout and capture_logs sentences partially restate parameter descriptions already in the schema.

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?

With no output schema, the description supplies the return contract itself (return values, errors with traceback, optional console lines and script errors). For a five-parameter mutation tool with full schema coverage and destructive annotations, the combination of behavior, prerequisites, and safety warning is sufficient to invoke it correctly.

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 coverage is 100%, so the baseline is 3. The description reinforces capture_logs and timeout_ms usage and notes the connected-state requirement, but adds no syntax or format detail (e.g. how 'return' interacts with the serialized result) beyond what the schema already documents per-parameter.

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 Lua code inside the connected Roblox executor") and immediately declares the two possible outcomes (serialized return values, or error with traceback). No sibling tool in the list executes code, so the boundary is unambiguous even without naming an alternative.

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?

Gives concrete operational guidance: set capture_logs to collect console lines, use timeout_ms for long-running code, and only run code the user asked for. It also states the prerequisite "Requires the connected state." It stops short of explicitly routing to siblings (e.g. preferring get_logs/get_script_source for read-only inspection), so it is clear context rather than a full when/when-not statement.

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