Skip to main content
Glama

run_luau

Destructive

Execute Luau code in Roblox Studio's edit mode to capture return values and printed output with full plugin API access.

Instructions

Execute Luau in the Studio plugin context (EDIT mode — runs against the edit DataModel, not a running playtest's server/client). Captures the return value and printed output. Full plugin API access. For code that must run INSIDE a live play session, use Roblox's official Studio MCP (execute_luau); for code that must run against the PUBLISHED game on Roblox's servers, use cloud_luau instead.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "run_luau"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesLuau source to run
placeNoTarget place (PlaceId or project name). Defaults to the bound/sole connected place.
timeoutBudgetNoseconds before a yielding script is reported as stuck (default 30, max 85)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false, and openWorldHint=false, so safety is partly structured. The description adds genuinely non-redundant behavior: it runs in EDIT mode against the edit DataModel, has full plugin API access, and captures both return value and printed output. It does not explain why the operation is destructive or whether DataModel mutations persist, which is the main remaining gap given the destructive hint.

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?

Three sentences, front-loaded with the execution environment, then output capture, then the disambiguation routing. Every clause earns its place and no wording is redundant.

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 an arbitrary-code-execution tool with no output schema, the description covers the return contract ('captures the return value and printed output'), the environment, and the alternatives. The one omission is any note on persistence or side effects of mutations to the DataModel, which matters for a destructive-hinted 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%, with code, place, and timeoutBudget all documented including the default-30/max-85 timeout semantics. The description adds no parameter-level detail beyond the code-execution context, so the schema carries the semantic load and the baseline 3 applies.

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 ('Execute Luau in the Studio plugin context') and immediately qualifies the execution environment as EDIT mode against the edit DataModel rather than a playtest server/client. This is enough for an agent to distinguish it from cloud_luau and the official Studio MCP's execute_luau without opening either schema.

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

Usage Guidelines5/5

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

Explicitly states the selection condition for the primary use case (edit DataModel) and names two alternatives with their respective conditions: Roblox's official Studio MCP execute_luau for live play sessions, and cloud_luau for the published game on Roblox's servers. When-to-use and when-not-to-use are both covered.

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