Skip to main content
Glama

luau_run

Run Luau code in Roblox Studio to get print/warn output, serialized return values, and line-numbered errors for queries and undoable one-off edits.

Instructions

Run Luau in Studio and get back print/warn output, the return value (Instances, Vector3, tables… are serialized) and errors with line numbers. Use for queries and one-off edits; changes are undoable (history action=undo). Code runs on Studio's main thread: in long loops call task.wait() every ~1000 iterations. Top-level return works.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "luau_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeNoLuau source. Either code or file is required.
fileNoPath to a local .luau file to run instead of inline code.
studioNoOptional. Target Studio (name substring, place id or id). Only needed when several Studios are open and none was selected.
contextNoDatamodel to run in. Default: edit when not playing, otherwise server.
timeout_sNoDefault 60, max 600.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses serialization of Instances/Vector3/tables, error reporting with line numbers, undoability, and the main-thread blocking risk with the task.wait() mitigation. It omits output-size/truncation behavior and whether failures raise or return, but the risky behaviors are covered.

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

Conciseness5/5

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

The capability and return contract come first, followed by usage, safety, and the operational caveat. Every sentence supplies information an agent needs to call this correctly; there is no filler.

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

Completeness4/5

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

For a five-parameter code-execution tool with no output schema and no annotations, the description covers purpose, return format, undo semantics, and the main-thread hazard. Remaining gaps are output truncation and the exact error-result shape, which are minor but real for an execution 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 coverage is 100% and every parameter is documented in the schema, including the code/file requirement and the context default, so the baseline is 3. The description adds only tangential meaning (top-level return works, wait cadence) rather than clarifying individual parameters such as timeout_s or studio selection.

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 Luau in Studio') and immediately defines the return shape: print/warn output, a serialized return value, and errors with line numbers. The 'one-off edits' framing implicitly separates it from persistent-script siblings such as script_edit/script_write.

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?

'Use for queries and one-off edits' gives clear positive guidance and the undoability note clarifies the risk profile. It stops short of naming an alternative tool or stating when NOT to use it (e.g., prefer script_edit for persistent source edits), so it is clear context without explicit exclusions.

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