Skip to main content
Glama
okenjioxx

Roblox Executor MCP Server

by okenjioxx

List a closure's nested function prototypes

get-closure-protos
Read-onlyIdempotent

Resolve a Luau expression to a function and list its nested prototypes, mapping inner callbacks and helpers. Returns each proto's metadata to feed pointers into other closure tools.

Instructions

Resolve a Luau expression to a function and enumerate its nested prototypes (protos) via getprotos. Protos are the inner functions defined inside a closure — closures it creates, callbacks it registers, helper functions in its body. Walking protos lets you drill into a top-level script function to reach the exact inner handler you care about (e.g. an anonymous OnClientEvent callback) without scanning the whole GC, and to map a script's internal call structure. For each proto this returns the full __fnInfo (IsLua/IsC, Name, Source, ShortSource, LineDefined, NumParams, IsVararg, NumUpvalues, Pointer) so you can immediately feed a Pointer/path back into the other closure tools. Requires the executor's getprotos (debug.getprotos); if unavailable a clean { error } is returned. Returns { Target, Info, Protos:[__fnInfo...], 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 nested prototypes you want, e.g. 'getscriptclosure(game.Players.LocalPlayer.PlayerScripts.Main)', 'getsenv(script).init', or 'getrawmetatable(game).__namecall'. 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/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint, idempotentHint, destructiveHint false), so the bar is lower, and the description adds real context: it depends on the executor's debug.getprotos and returns a clean { error } when unavailable. It also discloses the return shape and the __fnInfo fields, which goes beyond the annotations.

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?

Core purpose and behavior are front-loaded in the first sentences. The trailing metadata block (Phase/cost/idempotency/Requires/Capabilities/Produces/Safety/On failure) is somewhat formulaic and 'Safety: read-only' repeats the annotation, but it remains scannable and does not bury the main point.

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 fully carries the return contract: { Target, Info, Protos:[__fnInfo...], Count } or { error }, plus the enumerated __fnInfo fields and how to feed a Pointer back into other closure tools. Nothing an agent needs to invoke and interpret it is missing.

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%, so the schema already documents functionPath and threadContext thoroughly, including example expressions. The description only restates the signature and the notion of resolving a Luau expression, adding little beyond the structured schema; 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?

States a specific verb and resource ('Resolve a Luau expression to a function and enumerate its nested prototypes') and defines the concept ('inner functions defined inside a closure'). It implicitly separates itself from GC-wide scanning and from the other closure tools, but never names the very close sibling get-function-protos, so an agent must infer the boundary.

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 when-to-use framing: drill into a top-level script function to reach a specific inner handler (e.g. an anonymous OnClientEvent callback) 'without scanning the whole GC', and to map a script's internal call structure. It implies the alternative (GC-wide scanning) but does not explicitly state when-not to use it or name a competing sibling.

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