Skip to main content
Glama
okenjioxx

Roblox Executor MCP Server

by okenjioxx

Set a constant of a live function (MUTATES STATE)

set-closure-constant
Destructive

Patch a Luau function's bytecode constant to change its behavior, like swapping a hardcoded string or redirecting a method call.

Instructions

WRITES LIVE GAME STATE. DANGER — Resolve a Luau expression to a function and overwrite one of its bytecode constants via setconstant. Constants are the literal values baked into a function's bytecode (numbers, strings, the names of globals/methods it calls). Patching one changes the function's behavior the next time it runs — e.g. rewrite a magic number, swap a hardcoded string, or redirect a method call by changing its name constant. This persists for the exact closure and can destabilize the game or trip anticheat; some executors only allow same-type replacement. Index is 1-based and must be within the function's constant count (inspect-closure reports ConstantCount). Requires setconstant. Pass confirm=true to proceed. Returns { Target, Index, ok } or { error }. Signature: { functionPath: string, index: number, value: { kind: "string" | "number" | "boolean" | "nil" | "raw", value: string | number | boolean? }, confirm: boolean, threadContext: number? }. Phase: act; cost=medium; idempotency=idempotent-write. Requires: active-client, resolved-target, explicit-mutation-approval. Capabilities: debug closure primitives. Produces: operation-receipt. Verify with: assert-state. Safety: MUTATING; writes live game/client state. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexYes1-based index of the constant to overwrite. Must be within the function's constant count (see ConstantCount from inspect-closure).
valueYesNew value for the constant. kind 'string'|'number'|'boolean' uses value literally; kind 'nil' sets nil; kind 'raw' treats value as a Luau expression evaluated for its result. Note: many executors require the replacement to be the same type as the original constant.
confirmYesMust be true to actually mutate the live function. When omitted or false, the tool refuses and changes nothing.
functionPathYesLuau expression resolving to the function whose constant you want to change, e.g. 'getsenv(game.Players.LocalPlayer.PlayerScripts.Main).fire' or a function found via scan-closures-by-source. Evaluated as `return <functionPath>`.
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.4/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true/readOnlyHint=false, but the description adds substantial context beyond them: scope of persistence ('persists for the exact closure'), risk ('can destabilize the game or trip anticheat'), an executor-specific constraint ('some executors only allow same-type replacement'), and the confirm-gating behavior. The only wrinkle is the self-declared 'idempotency=idempotent-write' label sitting alongside idempotentHint=false, but this is a taxonomy field rather than a claim about the tool's effect, and the safety-relevant annotations are fully consistent with the text.

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?

The DANGER warning and the explanation of constants are front-loaded, which is correct for a destructive mutation tool. It is long, however, and the trailing metadata block (phase/cost/signature) partially duplicates the schema rather than earning its place.

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?

Despite having no output schema, the description specifies the return shape ({ Target, Index, ok } or { error }) and failure handling ('inspect tool-schema for exact fields, defaults, constraints'). It also covers prerequisites, verification (assert-state), and safety, so an agent has everything needed to call 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 schema already documents index bounds, value.kind semantics, confirm behavior, and functionPath evaluation. The description restates the same facts (1-based index, same-type constraint) and its Signature line simply mirrors the schema, adding little beyond the baseline. The 'requires setconstant' note is the only genuinely additive element.

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?

The description names a precise verb+resource ('overwrite one of its bytecode constants via setconstant') and defines what a constant is (literal values baked into bytecode), which distinguishes it from sibling tools like set-closure-upvalue, get-closure-constants, and inspect-closure. It even enumerates concrete outcomes (rewrite a magic number, swap a string, redirect a method call).

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?

It gives clear preconditions ('Requires setconstant', 'Pass confirm=true to proceed', index must be within ConstantCount from inspect-closure) and use cases, and points to assert-state for verification. It stops short of an explicit when-not-to-use or a named alternative (e.g., set-closure-upvalue for upvalue edits), so it is strong but not complete.

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