Read a closure's constant pool
get-closure-constantsResolve a Luau expression to a function and dump its constant pool via getconstants. Use strings, numbers, and names to fingerprint closure behavior without reading source.
Instructions
Resolve a Luau expression to a function and dump its constant pool via getconstants. Constants are the literal values the bytecode references — strings, numbers, table keys, global names, and embedded function/method names — so they are the fastest way to fingerprint what a closure does (e.g. spotting a 'FireServer' literal, a remote name, a damage value, or a URL) without reading its source. This is the by-reference companion to the GC-wide scanners (find-functions-by-constant / find-constants-xref): use it once you already hold the function (a remote handler, a metamethod, getsenv(script).fn, etc.). Each entry reports its 1-based Index, Luau Type, and an encoded Value. Requires the executor's getconstants (debug.getconstants); if unavailable a clean { error } is returned. Returns { Target, Info, Constants:[{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
| Name | Required | Description | Default |
|---|---|---|---|
| functionPath | Yes | Luau expression resolving to a function whose constants you want, e.g. 'getsenv(game.Players.LocalPlayer.PlayerScripts.Main).update', 'getrawmetatable(game).__namecall', or 'getconnections(game.ReplicatedStorage.Remote.OnClientEvent)[1].Function'. Evaluated as `return <functionPath>`. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |