Skip to main content
Glama
okenjioxx

Roblox Executor MCP Server

by okenjioxx

Read a closure's upvalues (captured variables)

get-closure-upvalues
Read-onlyIdempotent

Resolve a Luau expression to a function and dump its upvalues to inspect captured variables and hidden closure state for reverse-engineering.

Instructions

Resolve a Luau expression to a function and dump its upvalues via getupvalues. Upvalues are the variables a closure captured from its enclosing scope — the live state a function carries with it (config tables, cached remotes, counters, references to other functions, flags). Inspecting them reveals hidden state that source code alone does not show, which is invaluable when reverse-engineering a handler or locating a kill-switch/flag to flip. This is the by-reference companion to find-upvalue-xref. Each entry reports its 1-based Index, Luau Type, and an encoded Value; the same Index is what set-closure-upvalue mutates. Requires the executor's getupvalues (debug.getupvalues); if unavailable a clean { error } is returned. Returns { Target, Info, Upvalues:[{Index,Type,Value}], Count } or { error }. Signature: { functionPath: string, threadContext: number? }. Phase: observe; cost=medium; idempotency=read-only. Requires: active-client, resolved-target. Capabilities: debug closure primitives. Produces: structured-observation. Safety: read-only. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
functionPathYesLuau expression resolving to a function whose upvalues you want, e.g. 'getsenv(game.Players.LocalPlayer.PlayerScripts.Main).step', 'getrawmetatable(game).__index', or 'getconnections(workspace.Part.Touched)[1].Function'. Evaluated as `return <functionPath>`. Captured variables are editable by Index via set-closure-upvalue.
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/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), yet the description adds real behavioral context beyond them: it depends on the executor's getupvalues (debug.getupvalues) and returns a clean { error } when unavailable, plus phase/cost/prerequisite metadata. No contradiction with annotations; a solid addition without being exhaustive on limits.

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?

Front-loaded with purpose and the key 'why', and most sentences earn their place. It runs long with a trailing metadata block (Phase/cost/Capabilities/'On failure: inspect tool-schema...') that is somewhat boilerplate, slightly diluting conciseness.

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 full return contract ({ Target, Info, Upvalues:[{Index,Type,Value}], Count } or { error }), the field meanings, dependency requirements, and error behavior — everything an agent needs to call and interpret it.

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 both parameters (functionPath, threadContext) already carry detailed schema descriptions. The description only restates the signature and adds no syntax or meaning beyond the schema, so the baseline 3 applies.

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

Purpose4/5

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

The description states a specific verb+resource ('Resolve a Luau expression to a function and dump its upvalues via getupvalues') and distinguishes this tool from find-upvalue-xref ('by-reference companion') and set-closure-upvalue (consumes the same Index). It does not, however, differentiate from the very close sibling get-function-upvalues, leaving a real selection ambiguity.

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 clear motivating context: use it to reveal hidden closure state when reverse-engineering a handler or locating a kill-switch/flag to flip. It names a related tool (find-upvalue-xref, set-closure-upvalue) but offers no explicit when-not conditions or a full alternative matrix.

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