MCP debug_stacktrace
Description
Get the current BrightScript call stack for a stopped thread, wrapping the device's STACKTRACE command over Roku's socket-based BrightScript debug protocol (TCP 8081) -- NOT the Microsoft Debug Adapter Protocol.
Requires the app to be fully stopped (every thread halted) -- calling this while running returns an error saying to wait for the app to stop and retry.
Frames are always ordered innermost-first (index 0 = the current/most recent call), matching CDP's callFrames convention. This tool is BrightScript-only and takes no runtime parameter: CDP already exposes its own call stack via debug_state's/cdp_debugger_state's callFrames, so there is nothing on the TypeScript side for a runtime param to route to.
Only frame 0 (the stop location) carries a code_snippet -- the protocol's STACKTRACE response has no snippet field for any frame; frame 0's is backfilled from the same cached source dap_threads uses.
Optional parameters:
- threadId (string): Namespaced thread id, e.g.
brs:0. Uses the session's default thread (see
dap_thread_select) when omitted. - sessionId (string): Session id returned by debug_session_create. Uses the active session when
omitted.
See also
- HTTP debugGetStackTrace (
GET /api/debug/stacktrace) - rk debug stacktrace
Parameters
additionalProperties: false
| Name | Type | Required | Values |
|---|---|---|---|
| threadId | string | No | |
| sessionId | string | No |
threadId
Namespaced thread id, e.g. brs:0
sessionId
Session id returned by debug_session_create
Updated about 3 hours ago