Find xrefs TO a function (IDA 'xrefs to')
find-function-xrefsResolve a Roblox Luau function from an expression, then find every GC function that references it via upvalues or nested protos.
Instructions
Resolve a target Luau FUNCTION from an expression, then walk every function in the GC and report which ones REFERENCE it — the runtime equivalent of IDA's 'cross references to' on a sub. A referrer references the target if the target appears in its upvalues (closures that captured it) OR among its nested protos (functions that embed it as an inner function). Each xref reports __fnInfo (ptr/name/source/line/nparams/nups) plus 'via' ("upvalue" or "proto"). The target itself is skipped. Requires getgc + getupvalues/getprotos; caps the scan and flags truncation. Pivot from list-gc-functions or lookup-function to get an expression that resolves here. Signature: { functionPath: 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). | |
| functionPath | Yes | Luau expression that resolves to the TARGET function, e.g. 'getrenv().game.ReplicatedStorage.Modules.Combat.attack' or 'require(path).onHit'. Evaluated as `(loadstring('return '..expr))()`; must yield type=='function' or the tool errors. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |