List a closure's nested function prototypes
get-closure-protosResolve 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
| Name | Required | Description | Default |
|---|---|---|---|
| functionPath | Yes | Luau 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>`. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |