metro_state
Evaluate a JavaScript expression to read React Native app state via Metro CDP debugger, such as Redux store values. Auto-discovers the debugger connection and supports custom expressions.
Instructions
Reads app state from a React Native app by evaluating a JS expression in its runtime via the Metro CDP debugger (Runtime.evaluate, returnByValue). Default expression reads a globally-exposed Redux store; override expression to read any in-app value. The app must expose the value on a global the runtime can reach. Auto-discovers the ws via metro_apps when omitted.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "metro_state"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression | No | JS expression to evaluate (default: a globally-exposed Redux store's getState()). e.g. "store.getState().user" or "globalThis.__APP_STATE__". | |
| webSocketDebuggerUrl | No | CDP WebSocket URL from metro_apps. Omit to auto-discover. | |
| port | No | Metro port for auto-discovery (default 8081) | |
| timeoutMs | No | Evaluation timeout in ms (default 5000) |