Walk a thread/coroutine's call stack
get-thread-stackWalk a Luau thread or coroutine's call stack frame by frame to see exactly where it is executing; omit the thread path to inspect the current thread.
Instructions
Walk the call stack of a Luau thread/coroutine frame-by-frame using debug.info. For each level it reports the function Name, Source, and Line (debug.info(thread, level, 'nsl')), stopping when the stack is exhausted. If threadPath is omitted it traces the CURRENT injected thread instead, using debug.info(level, 'nsl'). A debug.traceback() string is also included when available. Use this to see exactly where a suspended coroutine or an event handler's thread is currently executing — e.g. pass a connection's .Thread, a stored coroutine, or leave it blank to inspect your own execution context. WARNING: this ACTS ON THE LIVE GAME — it evaluates your threadPath expression and introspects live thread state in the running client. Returns { Thread?, FrameCount, Frames:[{ Level, Name, Source, Line }], Traceback? } or { error }. Signature: { threadPath: string?, maxLevels: any?, threadContext: number? }. Phase: observe; cost=medium; idempotency=read-only. Requires: active-client, resolved-target. 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 |
|---|---|---|---|
| maxLevels | No | Maximum number of stack levels to walk before stopping (default 20, max 60). Walking stops early once debug.info returns nil for a level (top of stack reached). | |
| threadPath | No | Optional Luau expression resolving to a thread/coroutine, e.g. 'getconnections(game.Workspace.Part.Touched)[1].Thread', 'getgenv().myCoroutine', or 'coroutine.running()'. Evaluated as `return <threadPath>`. If omitted, the current injected thread is traced instead. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |