Reference
debug
The JavaScript runtime of a React Native debug build, through its dev server (Metro): connect, and evaluate code. Experimental and local only. Index · shared schemas · errors.
| Procedure | Summary | REST | MCP tool | Stability |
|---|---|---|---|---|
debug.connect | Connect to the JavaScript runtime of a React Native debug build running on this session's device, through its dev server (Metro). The runtime is the one the dev server lists for this app on this session's own device, never a guess: anything else is refused with JS_RUNTIME_UNAVAILABLE, which lists what the dev server has. An app launched with devServerUrl is connected automatically when its runtime admits several debuggers (multipleDebuggers true). On a runtime that admits one, Troupe leaves it alone (JS_RUNTIME_UNAVAILABLE, single-debugger) until this call, which takes that one seat and closes React Native DevTools if it is open. Call this also to name another dev server or app, to take the runtime back after another debugger replaced Troupe, or to read the connection's state. While connected, the app's console calls and uncaught errors are the session's log lines with source js (logs.read), and ui.describeAt names the React components at a point with their source file and line. | POST | — | experimental |
debug.evaluate | Run a JavaScript expression in the app's JavaScript runtime, as React Native DevTools' console would, and return its value as JSON (at most 64 KiB). It runs any code in the app, with the app's own access, so it needs the apps:debug scope as well; the runtime is the one debug.connect connected. A thrown error comes back in exception, not as a failed call. | POST | — | experimental |
debug.connect
Connect to the JavaScript runtime of a React Native debug build running on this session's device, through its dev server (Metro). The runtime is the one the dev server lists for this app on this session's own device, never a guess: anything else is refused with JS_RUNTIME_UNAVAILABLE, which lists what the dev server has. An app launched with devServerUrl is connected automatically when its runtime admits several debuggers (multipleDebuggers true). On a runtime that admits one, Troupe leaves it alone (JS_RUNTIME_UNAVAILABLE, single-debugger) until this call, which takes that one seat and closes React Native DevTools if it is open. Call this also to name another dev server or app, to take the runtime back after another debugger replaced Troupe, or to read the connection's state. While connected, the app's console calls and uncaught errors are the session's log lines with source js (logs.read), and ui.describeAt names the React components at a point with their source file and line.
| REST | POST /v1/debug/connect (input as a JSON body) |
| RPC | /rpc/v2/debug/connect |
| MCP | not a tool (experimental: attaches to or runs code in an app's JavaScript runtime; in the all toolset); hints: idempotent |
| Auth | devices:drive |
| Tenancy | project |
| Troupe Cloud | not served; local runtime only |
| Stability | experimental, since 1.0 |
Input:
{
sessionId: SessionId
bundleId?: BundleId
devServerUrl?: string // ≤ 2048 chars; url
timeoutMs?: TimeoutMs // default 10000
}Output:
JsRuntimeErrors: D, JS_RUNTIME_UNAVAILABLE.
Named types: BundleId, JsRuntime, SessionId, TimeoutMs.
debug.evaluate
Run a JavaScript expression in the app's JavaScript runtime, as React Native DevTools' console would, and return its value as JSON (at most 64 KiB). It runs any code in the app, with the app's own access, so it needs the apps:debug scope as well; the runtime is the one debug.connect connected. A thrown error comes back in exception, not as a failed call.
| REST | POST /v1/debug/evaluate (input as a JSON body) |
| RPC | /rpc/v2/debug/evaluate |
| MCP | not a tool (experimental: attaches to or runs code in an app's JavaScript runtime; in the all toolset); hints: none |
| Auth | devices:drive and apps:debug |
| Tenancy | project |
| Troupe Cloud | not served; local runtime only |
| Stability | experimental, since 1.0 |
Input:
{
sessionId: SessionId
expression: string // 1–65536 chars
awaitPromise?: boolean // default true
timeoutMs?: TimeoutMs // default 5000
}Output:
{
type: 'undefined' | 'object' | 'function' | 'string' | 'number' | 'boolean' | 'symbol' | 'bigint' | …
subtype?: string
value?: unknown
description?: string
truncated: boolean
exception?: { text: string; stack?: string }
}Errors: D, JS_RUNTIME_UNAVAILABLE, TIMEOUT.