Find functions that reference an Instance (IDA data xrefs)
find-instance-xrefsFind every garbage-collected function that references a target Roblox Instance, using its Luau path, by checking upvalues and constants.
Instructions
Resolve a target Instance from a Luau expression, then walk every function in the GC and report which ones hold a reference to it — the runtime equivalent of IDA's data cross-references on a global object. A referrer references the instance if it appears in the function's upvalues OR constants. Answers 'which functions read, manipulate, or watch this object?'. Each xref reports __fnInfo (ptr/name/source/line/nparams/nups) plus 'via' ("upvalue" or "constant"). Requires getgc + getupvalues/getconstants; caps the scan and flags truncation. Signature: { instancePath: string, limit: any?, maxScan: any?, threadContext: number? }. Phase: observe; cost=medium; idempotency=read-only. Requires: active-client, resolved-target. Produces: bounded-candidates. Safety: read-only. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max referrer functions (xrefs) to return (default 100). | |
| maxScan | No | Max GC functions to scan (default 9000). | |
| instancePath | Yes | Luau expression that resolves to the target Instance, e.g. 'game.Workspace.Boss' or 'game:GetService("Players").LocalPlayer.Character'. Evaluated as `(loadstring('return '..expr))()`; must yield typeof=='Instance' or the tool errors. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |