Find the most complex functions (RE starting points)
find-functions-by-complexityRanks Luau functions in the garbage collector by constant, upvalue, or nested-proto counts so you can prioritize which code to reverse-engineer first.
Instructions
Rank every Luau function in the GC by complexity so you know where to start reverse-engineering — the biggest, most interesting functions usually carry the core logic. For each function it counts the number of constants, upvalues, and nested protos, then returns the top limit by the chosen metric (sortBy), heaviest first. Each entry reports the owning script source, line, function name and pointer, plus the three counts. Pivot from here with get-closure-constants / find-string-xrefs / call-graph tools. Requires getgc + getconstants/getupvalues/getprotos; caps the scan and flags truncation. Signature: { sortBy: any?, limit: any?, maxScan: any?, threadContext: number? }. Phase: observe; cost=medium; idempotency=read-only. Requires: active-client. 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 functions to return, heaviest first (default 50). | |
| sortBy | No | Which complexity metric to rank by: 'constants' (literals/strings/numbers used, default), 'upvalues' (captured variables), or 'protos' (nested child functions). | constants |
| maxScan | No | Max GC functions to scan (default 9000). | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |