Troupeby AliveDocsSign in

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.

ProcedureSummaryRESTMCP toolStability
debug.connectConnect 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.evaluateRun 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.

RESTPOST /v1/debug/connect (input as a JSON body)
RPC/rpc/v2/debug/connect
MCPnot a tool (experimental: attaches to or runs code in an app's JavaScript runtime; in the all toolset); hints: idempotent
Authdevices:drive
Tenancyproject
Troupe Cloudnot served; local runtime only
Stabilityexperimental, since 1.0

Input:

TypeScript
{
  sessionId: SessionId
  bundleId?: BundleId
  devServerUrl?: string  // ≤ 2048 chars; url
  timeoutMs?: TimeoutMs  // default 10000
}

Output:

TypeScript
JsRuntime

Errors: 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.

RESTPOST /v1/debug/evaluate (input as a JSON body)
RPC/rpc/v2/debug/evaluate
MCPnot a tool (experimental: attaches to or runs code in an app's JavaScript runtime; in the all toolset); hints: none
Authdevices:drive and apps:debug
Tenancyproject
Troupe Cloudnot served; local runtime only
Stabilityexperimental, since 1.0

Input:

TypeScript
{
  sessionId: SessionId
  expression: string  // 1–65536 chars
  awaitPromise?: boolean  // default true
  timeoutMs?: TimeoutMs  // default 5000
}

Output:

TypeScript
{
  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.

Named types: SessionId, TimeoutMs.

esc

    Type to search every page, the protocol reference and the cloud API.