Walk the current Luau call stack (debug.info frames)
get-call-stackUnwind the Luau call stack to see who called your code. Returns each frame's level, name, source, and line for debugging hook callbacks or deferred tasks.
Instructions
Unwind the current Luau call stack from the executing thread and return one frame per level: { level, name, source, line }. Walks debug.info(level, 'nsl') (name / source / currentline) from level 1 outward, stopping at the first level that yields nil or after maxLevels frames. Use it to see who is calling the code you just ran — the chain of functions leading into the current execution — which is invaluable when reasoning about a hook callback or a deferred task's origin. Requires debug.info (or debug.getinfo) — type-guarded and pcall-wrapped, returning { error } on an executor that lacks it. Returns { frames } or { error }. Signature: { maxLevels: number?, threadContext: number?, timeoutMs: number? }. Phase: observe; cost=medium; idempotency=read-only. Requires: active-client. Produces: structured-observation, operation-receipt. 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 frames to walk before stopping (default 20). | |
| timeoutMs | No | Optional per-call deadline in milliseconds; omit it to use the tool or server default. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |