Inspect a function/closure by reference
inspect-closureResolve a Luau expression to a function and dump its closure details—Lua/C type, source, params, upvalues, constants, proto count, and hash—to inspect known handler, metamethod, or getsenv reference.
Instructions
Resolve a Luau expression to a function and dump everything about it in one call: whether it's a Lua or C closure, its name/source/line/param count/upvalue count (via getinfo), its constants, its upvalues (captured values), its nested-proto count, and its function hash. This is the by-reference counterpart to the gc-scan tools (scan-closures-by-*) — use it when you already have a handle on the function (e.g. a remote's OnClientEvent handler, a metamethod, or getsenv(script).someFunc). Requires getinfo/getconstants/getupvalues as available; missing capabilities are simply omitted. Returns { Target, Info, Constants, Upvalues, ProtoCount, FunctionHash } or { error }. Signature: { functionPath: string, includeConstants: any?, includeUpvalues: any?, 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, e.g. 'getsenv(game.Players.LocalPlayer.PlayerScripts.Main).update', 'getrawmetatable(game).__namecall', or 'getconnections(game.Workspace.Part.Touched)[1].Function'. Evaluated as `return <functionPath>`. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. | |
| includeUpvalues | No | Include the function's upvalues — its captured variables (default true). | |
| includeConstants | No | Include the function's constants table (default true). |