get_positions
Read current positions from the Flox engine runtime snapshot. Returns a list of positions with account, strategy, symbol, quantity, average price, and unrealized P&L, or indicates the engine is not running.
Instructions
Read positions from a running flox engine via its runtime state snapshot. Use this when the user asks 'what's in my positions' / 'show me the BTC position' / 'is strategy X long or short'. Returns a JSON object {snapshot_age_ms, data:[{account, strategy, symbol_id, symbol_name, qty, avg_price, unrealized_pnl}, ...]}. Snapshot path is FLOX_RUNTIME_STATE env var or the passed state_path; the user app is responsible for writing the snapshot. When no engine has written a snapshot yet, returns {engine: 'not_running', data: [], hint: ...} instead of an error — that's a normal pre-engine state, not a problem to surface to the user. Read-only — never modifies state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account | No | Filter to one account. | |
| strategy | No | Filter to one strategy. | |
| state_path | No | Override snapshot path (defaults to FLOX_RUNTIME_STATE or /tmp/flox-runtime-state.json). |