{"serverInfo":{"name":"systemr-api-toolkit","version":"2.0.0","description":"Finance tools for agents, Python workflows, notebooks, and backend services. Use live discovery for current tool names and schemas."},"authentication":{"type":"header","header_name":"X-API-Key","description":"System R API key used for authenticated tool calls."},"tools":[{"name":"calculate_position_size","description":"Calculate optimal position size using the G-formula (geometric growth optimization). Given account equity, entry price, and stop loss, returns the number of shares, risk amount, notional value, and 1R in dollars.","inputSchema":{"type":"object","properties":{"equity":{"type":"string","description":"Account equity in USD (e.g. '100000')"},"entry_price":{"type":"string","description":"Planned entry price (e.g. '150.00')"},"stop_price":{"type":"string","description":"Stop loss price (e.g. '145.00')"},"direction":{"type":"string","enum":["long","short"],"description":"Trade direction"},"risk_percent":{"type":"string","description":"Risk as decimal (e.g. '0.02' for 2%). Optional."}},"required":["equity","entry_price","stop_price","direction"]}},{"name":"check_trade_risk","description":"Validate a proposed trade against Iron Fist risk rules. Checks position risk, portfolio risk, daily loss limits, and position count. Returns approval status, risk score (0-100), errors, and warnings.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol (e.g. 'AAPL')"},"direction":{"type":"string","enum":["long","short"],"description":"Trade direction"},"entry_price":{"type":"string","description":"Entry price"},"stop_price":{"type":"string","description":"Stop loss price"},"quantity":{"type":"string","description":"Number of shares/contracts"},"equity":{"type":"string","description":"Account equity in USD"},"daily_pnl":{"type":"string","description":"Daily P&L so far (default '0')"}},"required":["symbol","direction","entry_price","stop_price","quantity","equity"]}},{"name":"evaluate_performance","description":"Evaluate trading system performance using G-metric analysis. Accepts R-multiples from trade history and returns the geometric growth rate (G), expected R, variance, System R Score (0-100), and trend analysis. Three tiers: basic, full, comprehensive.","inputSchema":{"type":"object","properties":{"r_multiples":{"type":"array","items":{"type":"string"},"description":"R-multiples from trade history (minimum 2)"},"tier":{"type":"string","enum":["basic","full","comprehensive"],"description":"Evaluation tier (default 'basic')"},"window_size":{"type":"integer","description":"Rolling window size (default 10)"}},"required":["r_multiples"]}},{"name":"get_pricing","description":"Get current pricing for all System R operations. Returns a map of operation names to USDC costs. No authentication required. Free to call.","inputSchema":{"type":"object","properties":{}}},{"name":"analyze_drawdown","description":"Analyze drawdown from equity curve. Returns max drawdown (% and USD), current drawdown, average drawdown, drawdown count, longest duration, time in drawdown, recovery factor, ulcer index, and individual drawdown periods.","inputSchema":{"type":"object","properties":{"equity_values":{"type":"array","items":{"type":"string"},"description":"Equity values after each trade (e.g. ['100000', '101500', '99800'])"},"starting_equity":{"type":"string","description":"Initial equity before first trade (e.g. '100000')"},"net_profit":{"type":"string","description":"Total net profit in USD. Optional, used for recovery factor."}},"required":["equity_values","starting_equity"]}},{"name":"run_monte_carlo","description":"Run Monte Carlo simulation on trade distribution. Simulates future equity paths using historical R-multiples and returns probability of profit, 20%+ gain, 20%/50% drawdown, median/p5/p95 final equity.","inputSchema":{"type":"object","properties":{"r_multiples":{"type":"array","items":{"type":"string"},"description":"Historical R-multiples (minimum 2, e.g. ['1.5', '-0.8', '2.1', '-1.0'])"},"starting_equity":{"type":"string","description":"Starting equity for simulation (e.g. '100000')"},"num_simulations":{"type":"integer","description":"Number of simulations (default 1000, max 10000)"},"trades_per_simulation":{"type":"integer","description":"Trades per simulation (default 100)"},"risk_per_trade":{"type":"string","description":"Risk fraction per trade (default '0.01' = 1%)"}},"required":["r_multiples","starting_equity"]}},{"name":"calculate_kelly","description":"Calculate Kelly criterion position sizing fractions. Returns full Kelly, half Kelly (recommended), quarter Kelly (conservative), and risk of ruin estimate. Kelly fraction optimizes geometric growth rate (G).","inputSchema":{"type":"object","properties":{"r_multiples":{"type":"array","items":{"type":"string"},"description":"R-multiples from trade history (minimum 2)"}},"required":["r_multiples"]}},{"name":"find_variance_killers","description":"Identify trades that hurt geometric growth rate (G) the most. A variance killer is a trade whose deviation from mean damages G, even if individually profitable. Returns top 5 killers with G impact, variance contribution, and potential G improvement if removed.","inputSchema":{"type":"object","properties":{"r_multiples":{"type":"array","items":{"type":"string"},"description":"R-multiples from trade history (minimum 2)"},"trade_ids":{"type":"array","items":{"type":"string"},"description":"Trade identifiers (parallel to r_multiples). Optional."},"symbols":{"type":"array","items":{"type":"string"},"description":"Trading symbols (parallel to r_multiples). Optional."}},"required":["r_multiples"]}},{"name":"analyze_win_loss","description":"Calculate win/loss statistics from R-multiples. Returns win rate, loss rate, average win/loss in R and USD, payoff ratio, profit factor, expectancy, and net P&L. Provides the foundational metrics for evaluating a trading system.","inputSchema":{"type":"object","properties":{"r_multiples":{"type":"array","items":{"type":"string"},"description":"R-multiples from trade history"},"pnl_values":{"type":"array","items":{"type":"string"},"description":"USD P&L per trade (parallel to r_multiples). Optional."}},"required":["r_multiples"]}},{"name":"run_what_if","description":"Run what-if scenarios to find ways to improve G. Shows how G would change if: (1) losses were capped at -0.5R, -1R, -1.5R, -2R, or (2) worst 5%/10%/15%/20% of trades were avoided. Also identifies top 5 variance killers.","inputSchema":{"type":"object","properties":{"r_multiples":{"type":"array","items":{"type":"string"},"description":"R-multiples from trade history (minimum 2)"}},"required":["r_multiples"]}},{"name":"detect_regime","description":"Detect current market regime from OHLCV price bars. Classifies as TRENDING_UP, TRENDING_DOWN, RANGING, LOW_VOLATILITY, or VOLATILE. Returns trend direction/strength, volatility state/percentile, ATR. Requires minimum 200 bars for SMA calculations; fewer bars returns {\"error\": \"insufficient_bars\", \"bars_provided\": N, \"bars_required\": 200, ...} — fetch more history and retry.","inputSchema":{"type":"object","properties":{"bars":{"type":"array","items":{"type":"object","properties":{"open":{"type":"string"},"high":{"type":"string"},"low":{"type":"string"},"close":{"type":"string"},"volume":{"type":"string"}},"required":["open","high","low","close","volume"]},"description":"OHLCV bars (minimum 200). Most recent bar last."}},"required":["bars"]}},{"name":"pre_trade_gate","description":"Complete pre-trade validation in one call. Combines position sizing (G-formula), risk check (Iron Fist rules), and system health assessment. Returns: optimal position size, risk approval, risk score, and system health status. Use this before every trade for comprehensive risk management.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol (e.g. 'AAPL')"},"direction":{"type":"string","enum":["long","short"],"description":"Trade direction"},"entry_price":{"type":"string","description":"Planned entry price"},"stop_price":{"type":"string","description":"Stop loss price"},"equity":{"type":"string","description":"Account equity in USD"},"daily_pnl":{"type":"string","description":"Daily P&L so far (default '0')"},"risk_percent":{"type":"string","description":"Risk as decimal (default '0.02' for 2%)"},"r_multiples":{"type":"array","items":{"type":"string"},"description":"Recent R-multiples for system health check. Optional."}},"required":["symbol","direction","entry_price","stop_price","equity"]}},{"name":"assess_trading_system","description":"Comprehensive trading system assessment. Runs G-metric evaluation, win/loss analysis, Kelly criterion, Monte Carlo simulation, drawdown analysis, what-if scenarios, and variance killer detection in a single call. Returns a complete diagnostic report of your trading system's health.","inputSchema":{"type":"object","properties":{"r_multiples":{"type":"array","items":{"type":"string"},"description":"R-multiples from trade history (minimum 10 recommended)"},"equity_values":{"type":"array","items":{"type":"string"},"description":"Equity values after each trade. Optional (for drawdown analysis)."},"starting_equity":{"type":"string","description":"Starting equity for Monte Carlo and drawdown (default '100000')"},"pnl_values":{"type":"array","items":{"type":"string"},"description":"USD P&L per trade. Optional (for detailed win/loss)."}},"required":["r_multiples"]}},{"name":"detect_patterns","description":"Detect price action patterns from OHLCV bars: breakouts, breakdowns, pullbacks, moving average crossovers (SMA 20/50, 50/200, EMA 9/21, MACD, RSI), RSI divergences, price gaps, and consolidation zones. Returns all active patterns with confirmation status and volume confirmation. Requires minimum 35 bars.","inputSchema":{"type":"object","properties":{"bars":{"type":"array","items":{"type":"object","properties":{"open":{"type":"string"},"high":{"type":"string"},"low":{"type":"string"},"close":{"type":"string"},"volume":{"type":"string"}},"required":["open","high","low","close","volume"]},"description":"OHLCV bars (minimum 35). Most recent bar last."}},"required":["bars"]}},{"name":"detect_structural_break","description":"Detect structural breaks in price distribution. Compares recent 20 bars vs historical 200 bars across mean return, standard deviation, skewness, and kurtosis. Flags a break when any metric deviates >2 standard deviations. Returns break type (return_shift, volatility_shift, mean_departure), severity (0-1), z-score, and rolling statistics. Requires minimum 221 bars.","inputSchema":{"type":"object","properties":{"bars":{"type":"array","items":{"type":"object","properties":{"open":{"type":"string"},"high":{"type":"string"},"low":{"type":"string"},"close":{"type":"string"},"volume":{"type":"string"}},"required":["open","high","low","close","volume"]},"description":"OHLCV bars (minimum 221). Most recent bar last."}},"required":["bars"]}},{"name":"analyze_trend_structure","description":"Analyze trend structure using Bollinger Bands and ATR. Identifies current trend phase (EXPANSION, COMPRESSION, TRANSITION), Bollinger squeeze state (NONE, FORMING, ACTIVE, FIRING), momentum shift (ACCELERATING, DECELERATING, STEADY), expansion rate, and ATR trend. Squeeze firing = volatility explosion imminent. Requires minimum 21 bars.","inputSchema":{"type":"object","properties":{"bars":{"type":"array","items":{"type":"object","properties":{"open":{"type":"string"},"high":{"type":"string"},"low":{"type":"string"},"close":{"type":"string"},"volume":{"type":"string"}},"required":["open","high","low","close","volume"]},"description":"OHLCV bars (minimum 21). Most recent bar last."}},"required":["bars"]}},{"name":"calculate_indicators","description":"Calculate technical indicators from OHLCV bars. Supports: SMA (Simple Moving Average), EMA (Exponential Moving Average), RSI (Relative Strength Index), MACD (Moving Average Convergence Divergence), BB (Bollinger Bands), ATR (Average True Range). Returns the computed indicator value(s) for the most recent bar.","inputSchema":{"type":"object","properties":{"bars":{"type":"array","items":{"type":"object","properties":{"open":{"type":"string"},"high":{"type":"string"},"low":{"type":"string"},"close":{"type":"string"},"volume":{"type":"string"}},"required":["open","high","low","close","volume"]},"description":"OHLCV bars. Most recent bar last."},"indicator":{"type":"string","enum":["sma","ema","rsi","macd","bb","atr"],"description":"Indicator to calculate"},"period":{"type":"integer","description":"Indicator period (default: SMA/EMA=20, RSI=14, ATR=14, BB=20)"}},"required":["bars","indicator"]}},{"name":"calculate_indicators_for_symbol","description":"Fetch OHLCV bars for a symbol AND compute one or more technical indicators in a single call. PREFER this tool for any indicator query that names a ticker (e.g. 'SMA for AAPL', '30-day RSI on BTCUSD'). The tool fetches daily bars internally via canonical market data and returns bars metadata + indicator values + as_of timestamp + source provider. Supported indicators: sma, ema, rsi, macd, bb, atr. Do NOT chain get_ohlcv -> calculate_indicators; use this single-step tool instead. The legacy `calculate_indicators` tool only accepts pre-fetched bars and is for callers that already hold OHLCV data.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Ticker symbol (e.g. 'AAPL', 'BTCUSD', 'EURUSD'). Routed across providers automatically."},"period_days":{"type":"integer","description":"Optional. Number of trailing calendar days of daily bars to fetch. If omitted, inferred from the longest indicator period as `max(period) * 2 + 5`, clamped to [30, 730]. Pass an explicit value only if you need a specific window (e.g. forcing extra history)."},"indicators":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","enum":["sma","ema","rsi","macd","bb","atr"]},"period":{"type":"integer","description":"Indicator period. Defaults: sma/ema/bb=20, rsi/atr=14, macd=N/A."}},"required":["name"]},"description":"One or more indicator specs to compute over the fetched bars. Each spec has `name` and optional `period`. Example: [{\"name\": \"sma\", \"period\": 30}]."}},"required":["symbol","indicators"]}},{"name":"segment_trades","description":"Analyze G metrics by segment: which symbols, days, strategies, or regimes help vs hurt your geometric growth rate. Reveals where your edge lives. Returns per-segment G, E[R], variance, win rate, PnL, and whether each segment helps or hurts overall G.","inputSchema":{"type":"object","properties":{"trades":{"type":"array","items":{"type":"object","properties":{"pnl_r":{"type":"string","description":"P&L in R-multiples (e.g. '1.5', '-0.8')"},"pnl_usd":{"type":"string","description":"P&L in USD (e.g. '750', '-400')"},"symbol":{"type":"string","description":"Trading symbol (e.g. 'AAPL'). Optional."},"day_of_week":{"type":"integer","description":"Day of week (0=Monday, 6=Sunday). Optional."},"strategy_id":{"type":"string","description":"Strategy identifier. Optional."},"regime":{"type":"string","description":"Market regime (e.g. 'TRENDING_UP'). Optional."}},"required":["pnl_r","pnl_usd"]},"description":"Trade data with R-multiples and optional segment fields."},"segment_by":{"type":"string","enum":["symbol","day_of_week","strategy","regime"],"description":"Dimension to segment by (default 'symbol')"}},"required":["trades"]}},{"name":"analyze_execution_quality","description":"Analyze execution quality using MAE/MFE-style review from supplied trade data. Measures entry efficiency, exit efficiency, and hold time patterns. Poor execution increases variance, hurting G. Returns avg MAE/MFE in R, entry/exit efficiency (0-1), and hold time comparison for winners vs losers.","inputSchema":{"type":"object","properties":{"r_multiples":{"type":"array","items":{"type":"string"},"description":"R-multiples from trade history"},"mae_values":{"type":"array","items":{"type":"string"},"description":"Maximum Adverse Excursion in R (parallel to r_multiples). Optional."},"mfe_values":{"type":"array","items":{"type":"string"},"description":"Maximum Favorable Excursion in R (parallel to r_multiples). Optional."},"hold_times_hours":{"type":"array","items":{"type":"string"},"description":"Hold time in hours per trade (parallel to r_multiples). Optional."}},"required":["r_multiples"]}},{"name":"detect_peak_valley","description":"Detect peaks and valleys in your equity curve. Reveals the rhythm of your trading: ATH count, ATL depth, average peak-to-valley drops, average valley-to-peak gains, and current state (AT_PEAK, AT_VALLEY, BETWEEN).","inputSchema":{"type":"object","properties":{"equity_values":{"type":"array","items":{"type":"string"},"description":"Equity values after each trade (e.g. ['100000', '101500', '99800'])"},"starting_equity":{"type":"string","description":"Initial equity before first trade (e.g. '100000')"}},"required":["equity_values","starting_equity"]}},{"name":"calculate_rolling_g","description":"Calculate rolling G over sliding windows to track how your edge evolves. Answers: 'Is my G improving, stable, or declining?' Returns G values at each window, overall trend (IMPROVING/STABLE/DECLINING), and trend slope.","inputSchema":{"type":"object","properties":{"r_multiples":{"type":"array","items":{"type":"string"},"description":"R-multiples from trade history (minimum 2)"},"window_size":{"type":"integer","description":"Rolling window size (default 10)"}},"required":["r_multiples"]}},{"name":"analyze_price_structure","description":"Detect price structure: swing points, support/resistance levels, consolidation zones, and price position relative to key levels. Returns nearest support/resistance with distance, range position (0-1), SMA 20/50/200 as dynamic levels, and consolidation zones. Requires minimum 21 bars.","inputSchema":{"type":"object","properties":{"bars":{"type":"array","items":{"type":"object","properties":{"open":{"type":"string"},"high":{"type":"string"},"low":{"type":"string"},"close":{"type":"string"},"volume":{"type":"string"}},"required":["open","high","low","close","volume"]},"description":"OHLCV bars (minimum 21). Most recent bar last."}},"required":["bars"]}},{"name":"analyze_correlations","description":"Multi-symbol correlation analysis. Calculates pairwise correlations, detects correlated asset clusters, identifies correlation breakdowns, and assesses portfolio concentration risk. Requires 2+ symbols with 10+ bars each.","inputSchema":{"type":"object","properties":{"symbols_data":{"type":"array","items":{"type":"object","properties":{"symbol":{"type":"string","description":"Symbol name (e.g. 'AAPL')"},"bars":{"type":"array","items":{"type":"object","properties":{"open":{"type":"string"},"high":{"type":"string"},"low":{"type":"string"},"close":{"type":"string"},"volume":{"type":"string"}},"required":["open","high","low","close","volume"]},"description":"OHLCV bars for this symbol (minimum 10)"}},"required":["symbol","bars"]},"description":"Array of {symbol, bars} objects. Minimum 2 symbols."}},"required":["symbols_data"]}},{"name":"analyze_liquidity","description":"Analyze market liquidity from volume data. Classifies conditions as NORMAL, THINNING, STRESSED, or SPIKE. Returns relative volume, volume trend, volume percentile, participation rate, and spike detection. Requires minimum 2 bars.","inputSchema":{"type":"object","properties":{"bars":{"type":"array","items":{"type":"object","properties":{"open":{"type":"string"},"high":{"type":"string"},"low":{"type":"string"},"close":{"type":"string"},"volume":{"type":"string"}},"required":["open","high","low","close","volume"]},"description":"OHLCV bars (minimum 2). Most recent bar last."},"period":{"type":"integer","description":"Lookback period for averages (default 20)"}},"required":["bars"]}},{"name":"size_options_position","description":"Calculate optimal options position size. Four sizing modes: equity_risk (standard risk adapted for options), premium (max loss = premium), delta_adjusted (risk weighted by delta), spread (credit spread sizing). Returns number of contracts (conservative floor).","inputSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["equity_risk","premium","delta_adjusted","spread"],"description":"Sizing mode"},"equity":{"type":"string","description":"Account equity in USD"},"risk_pct":{"type":"string","description":"Risk per trade as decimal (e.g. '0.02' for 2%)"},"entry_premium":{"type":"string","description":"Option premium at entry (required for equity_risk, premium, delta_adjusted)"},"stop_premium":{"type":"string","description":"Option premium at stop (required for equity_risk, delta_adjusted)"},"delta":{"type":"string","description":"Option delta -1 to 1 (required for delta_adjusted)"},"spread_width":{"type":"string","description":"Distance between strikes (required for spread)"},"credit_received":{"type":"string","description":"Net credit received (required for spread)"},"contract_multiplier":{"type":"integer","description":"Contract multiplier (default 100 for US equity options)"}},"required":["mode","equity","risk_pct"]}},{"name":"size_futures_position","description":"Calculate optimal futures position size. Three sizing modes: margin_based (constrained by margin), tick_value (risk in ticks from entry to stop), notional (limits total notional exposure). Returns number of contracts (conservative floor).","inputSchema":{"type":"object","properties":{"mode":{"type":"string","enum":["margin_based","tick_value","notional"],"description":"Sizing mode"},"equity":{"type":"string","description":"Account equity (required for tick_value)"},"risk_pct":{"type":"string","description":"Risk per trade as decimal (required for tick_value)"},"entry_price":{"type":"string","description":"Entry price (required for tick_value)"},"stop_price":{"type":"string","description":"Stop loss price (required for tick_value)"},"tick_size":{"type":"string","description":"Minimum price increment (required for tick_value, e.g. '0.25' for ES)"},"tick_value":{"type":"string","description":"Dollar value per tick (required for tick_value, e.g. '12.50' for ES)"},"available_margin":{"type":"string","description":"Available margin (required for margin_based)"},"initial_margin_per_contract":{"type":"string","description":"Margin per contract (required for margin_based)"},"max_margin_usage_pct":{"type":"string","description":"Max margin usage as decimal (default '0.50')"},"max_notional":{"type":"string","description":"Maximum notional value (required for notional)"},"contract_price":{"type":"string","description":"Current futures price (required for notional)"},"contract_multiplier":{"type":"integer","description":"Contract multiplier (required for notional, e.g. 50 for ES)"}},"required":["mode"]}},{"name":"analyze_confidence","description":"Statistical confidence in your G estimate. Answers: 'Can I trust my G at this sample size?' Based on milestones: 30 trades = directional, 100 = reasonable, 1000 = confirmed edge. Returns confidence interval, margin of error, and sample size assessment.","inputSchema":{"type":"object","properties":{"r_multiples":{"type":"array","items":{"type":"string"},"description":"R-multiples from trade history (e.g. ['1.5', '-1.0', '2.3'])"}},"required":["r_multiples"]}},{"name":"analyze_consistency","description":"Analyze trading consistency: win/loss streaks, monthly patterns, and G stability. Reveals behavioral variance — do your results cluster or are they independent? Returns streak analysis, monthly breakdown, and consistency score.","inputSchema":{"type":"object","properties":{"r_multiples":{"type":"array","items":{"type":"string"},"description":"R-multiples from trade history"},"dates":{"type":"array","items":{"type":"string"},"description":"ISO datetime strings for each trade (parallel to r_multiples). Optional."}},"required":["r_multiples"]}},{"name":"analyze_correlation","description":"Detect trade outcome correlations: loss clustering (tilt) and win clustering (hot streaks). Independent outcomes mean position sizing works; correlated outcomes mean variance is amplified. Returns autocorrelation, run test, and clustering assessment.","inputSchema":{"type":"object","properties":{"r_multiples":{"type":"array","items":{"type":"string"},"description":"R-multiples from trade history (in chronological order)"}},"required":["r_multiples"]}},{"name":"analyze_distribution","description":"Analyze R-multiple distribution shape: percentiles, skewness, kurtosis, and histogram. Reveals tail risk and whether your system has fat tails. Positive skew = big winners, negative skew = big losers.","inputSchema":{"type":"object","properties":{"r_multiples":{"type":"array","items":{"type":"string"},"description":"R-multiples from trade history"},"bucket_count":{"type":"integer","description":"Number of histogram buckets (default 10). Optional."}},"required":["r_multiples"]}},{"name":"analyze_recovery","description":"Analyze recovery patterns after drawdowns. Reveals system resilience: how quickly do you bounce back? Fast recovery = robust system. Slow recovery = variance killing G. Returns recovery periods, average recovery time, and resilience score.","inputSchema":{"type":"object","properties":{"r_multiples":{"type":"array","items":{"type":"string"},"description":"R-multiples from trade history"},"initial_equity":{"type":"string","description":"Starting equity (e.g. '100000'). Default '100000'."}},"required":["r_multiples"]}},{"name":"analyze_risk_adjusted","description":"Calculate risk-adjusted performance: Sharpe, Sortino, and Calmar ratios. Compares your system's return per unit of risk against benchmarks. Sharpe > 1.5 is strong. Sortino focuses only on downside risk. Calmar = annualized return / max drawdown.","inputSchema":{"type":"object","properties":{"r_multiples":{"type":"array","items":{"type":"string"},"description":"R-multiples from trade history"},"risk_free_rate":{"type":"string","description":"Annual risk-free rate as decimal (default '0.05'). Optional."}},"required":["r_multiples"]}},{"name":"analyze_greeks","description":"Analyze options Greeks for an options chain. Returns ATM contract Greeks (delta, gamma, theta, vega, rho), probability metrics (prob ITM/OTM), value decomposition (intrinsic/extrinsic), and breakeven price. Also calculates max pain, put/call walls, and delta/gamma exposure.","inputSchema":{"type":"object","properties":{"chain":{"type":"array","items":{"type":"object","properties":{"symbol":{"type":"string","description":"OCC symbol e.g. SPY240315C00500000"},"underlying_symbol":{"type":"string","description":"Underlying ticker e.g. SPY"},"strike":{"type":"string","description":"Strike price"},"expiration":{"type":"string","description":"Expiration date ISO format (YYYY-MM-DD)"},"option_type":{"type":"string","enum":["CALL","PUT"]},"bid":{"type":"string","description":"Best bid price"},"ask":{"type":"string","description":"Best ask price"},"last":{"type":"string","description":"Last traded price"},"volume":{"type":"integer","description":"Contracts traded today"},"open_interest":{"type":"integer","description":"Total open contracts"},"implied_volatility":{"type":"string","description":"IV as decimal (e.g. '0.25' for 25%)"},"delta":{"type":"string","description":"Option delta (optional)"},"gamma":{"type":"string","description":"Option gamma (optional)"},"theta":{"type":"string","description":"Option theta (optional)"},"vega":{"type":"string","description":"Option vega (optional)"},"rho":{"type":"string","description":"Option rho (optional)"}},"required":["symbol","underlying_symbol","strike","expiration","option_type","bid","ask","last","volume","open_interest","implied_volatility"]},"description":"Options chain - list of option quotes"},"underlying_price":{"type":"string","description":"Current underlying price (e.g. '500.00')"},"risk_free_rate":{"type":"string","description":"Risk-free rate as decimal (default '0.05'). Optional."}},"required":["chain","underlying_price"]}},{"name":"analyze_iv_surface","description":"Analyze implied volatility surface: IV rank, IV percentile, term structure (contango/backwardation/flat), skew ratio, expected move, and IV regime (LOW/NORMAL/HIGH/EXTREME). Requires options chain and historical IV data. Essential for options strategy selection.","inputSchema":{"type":"object","properties":{"chain":{"type":"array","items":{"type":"object","properties":{"symbol":{"type":"string"},"underlying_symbol":{"type":"string"},"strike":{"type":"string"},"expiration":{"type":"string"},"option_type":{"type":"string","enum":["CALL","PUT"]},"bid":{"type":"string"},"ask":{"type":"string"},"last":{"type":"string"},"volume":{"type":"integer"},"open_interest":{"type":"integer"},"implied_volatility":{"type":"string"},"delta":{"type":"string"},"gamma":{"type":"string"},"theta":{"type":"string"},"vega":{"type":"string"},"rho":{"type":"string"}},"required":["symbol","underlying_symbol","strike","expiration","option_type","bid","ask","last","volume","open_interest","implied_volatility"]},"description":"Options chain"},"iv_history":{"type":"array","items":{"type":"string"},"description":"Historical IV values as decimals (up to 252 trading days, e.g. ['0.20', '0.22', '0.18'])"},"underlying_price":{"type":"string","description":"Current underlying price"},"risk_free_rate":{"type":"string","description":"Risk-free rate as decimal (default '0.05'). Optional."}},"required":["chain","iv_history","underlying_price"]}},{"name":"analyze_futures_curve","description":"Analyze futures term structure: curve shape (contango/backwardation/flat/mixed), basis and basis percentage, annualized carry cost, roll yield, days to roll, and open interest trend. Requires at least 2 contract months.","inputSchema":{"type":"object","properties":{"contracts":{"type":"array","items":{"type":"object","properties":{"symbol":{"type":"string","description":"Contract symbol e.g. ESH26"},"underlying":{"type":"string","description":"Root symbol e.g. ES"},"expiration":{"type":"string","description":"Expiration date ISO format"},"last_price":{"type":"string","description":"Last traded price"},"settlement_price":{"type":"string","description":"Official settlement price"},"volume":{"type":"integer","description":"Contracts traded today"},"open_interest":{"type":"integer","description":"Total open contracts"},"tick_size":{"type":"string","description":"Min price increment (e.g. '0.25')"},"tick_value":{"type":"string","description":"Dollar value per tick (e.g. '12.50')"},"contract_size":{"type":"string","description":"Point value multiplier (e.g. '50')"},"initial_margin":{"type":"string","description":"Initial margin per contract"},"maintenance_margin":{"type":"string","description":"Maintenance margin per contract"}},"required":["symbol","underlying","expiration","last_price","settlement_price","volume","open_interest","tick_size","tick_value","contract_size","initial_margin","maintenance_margin"]},"description":"Futures contracts (at least 2)","minItems":2},"spot_price":{"type":"string","description":"Current spot/index price for the underlying"}},"required":["contracts","spot_price"]}},{"name":"analyze_options_flow","description":"Analyze options flow sentiment: flow direction (BULLISH/BEARISH/NEUTRAL/MIXED), unusual activity detection (volume/OI spikes), premium analysis (net call vs put premium), and large trade count. Reveals institutional positioning and smart money signals.","inputSchema":{"type":"object","properties":{"chain":{"type":"array","items":{"type":"object","properties":{"symbol":{"type":"string"},"underlying_symbol":{"type":"string"},"strike":{"type":"string"},"expiration":{"type":"string"},"option_type":{"type":"string","enum":["CALL","PUT"]},"bid":{"type":"string"},"ask":{"type":"string"},"last":{"type":"string"},"volume":{"type":"integer"},"open_interest":{"type":"integer"},"implied_volatility":{"type":"string"},"delta":{"type":"string"},"gamma":{"type":"string"},"theta":{"type":"string"},"vega":{"type":"string"},"rho":{"type":"string"}},"required":["symbol","underlying_symbol","strike","expiration","option_type","bid","ask","last","volume","open_interest","implied_volatility"]},"description":"Options chain"},"underlying_price":{"type":"string","description":"Current underlying price"}},"required":["chain","underlying_price"]}},{"name":"calculate_system_r_score","description":"Calculate System R Score (0-100) — a composite health score for your trading system. Five components (each 0-20): G Health, Variance Control, Statistical Significance, Consistency (rolling G stability), and Discipline (loss control). Letter grades: A+ (90-100), A (80-89), B (70-79), C (60-69), D (50-59), F (0-49). G-based caps: G<0 caps at 35, G<0.1 caps at 50, G<0.2 caps at 65.","inputSchema":{"type":"object","properties":{"r_multiples":{"type":"array","items":{"type":"string"},"description":"R-multiples from trade history (e.g. ['1.5', '-1.0', '2.3'])"},"window_size":{"type":"integer","description":"Rolling G window size (default 10). Optional."},"max_loss_r":{"type":"string","description":"Largest single loss R-multiple (e.g. '-2.5'). Optional — if not provided, discipline component scores neutral."}},"required":["r_multiples"]}},{"name":"calculate_pnl","description":"Calculate realized P&L, R-multiple, and holding time for a closed trade. Given entry/exit prices, direction, quantity, and fees, returns net P&L in dollars, P&L percentage, R-multiple (if stop provided), and holding time. Supports stocks (multiplier=1), options (multiplier=100), and futures.","inputSchema":{"type":"object","properties":{"entry_price":{"type":"string","description":"Average entry price (e.g. '150.00')"},"exit_price":{"type":"string","description":"Average exit price (e.g. '155.00')"},"quantity":{"type":"integer","description":"Number of shares/contracts"},"direction":{"type":"string","enum":["LONG","SHORT"],"description":"Trade direction"},"stop_price":{"type":"string","description":"Stop loss price for R-multiple calculation. Optional."},"total_fees":{"type":"string","description":"Total fees in dollars (default '0'). Optional."},"contract_multiplier":{"type":"string","description":"Contract multiplier: '1' for stocks, '100' for options (default '1'). Optional."},"entry_time":{"type":"string","description":"Entry timestamp ISO format for holding time. Optional."},"exit_time":{"type":"string","description":"Exit timestamp ISO format for holding time. Optional."}},"required":["entry_price","exit_price","quantity","direction"]}},{"name":"calculate_expected_value","description":"Calculate expected value (EV) in R-multiples, Kelly criterion fraction, and profit factor from trade statistics. Answers: 'Is my system profitable?' and 'How much should I risk per trade?' EV > 0 means positive expectancy. Kelly fraction determines optimal bet size.","inputSchema":{"type":"object","properties":{"win_rate":{"type":"string","description":"Win rate as decimal (e.g. '0.55' for 55%)"},"avg_win_r":{"type":"string","description":"Average winning trade in R-multiples (e.g. '1.5')"},"avg_loss_r":{"type":"string","description":"Average losing trade in R-multiples (positive, e.g. '1.0')"},"risk_amount":{"type":"string","description":"Dollar risk per trade for EV in dollars (e.g. '1000'). Optional."},"total_win_dollars":{"type":"string","description":"Total winning dollars for profit factor. Optional."},"total_loss_dollars":{"type":"string","description":"Total losing dollars for profit factor (positive). Optional."},"equity":{"type":"string","description":"Account equity for half-Kelly position size. Optional."},"risk_per_share":{"type":"string","description":"Dollar risk per share for half-Kelly shares. Optional."}},"required":["win_rate","avg_win_r","avg_loss_r"]}},{"name":"check_compliance","description":"US regulatory compliance checks: Pattern Day Trader (PDT) detection, wash sale rule identification, and T+1 settlement date calculation. PDT: Checks if a trade is a day trade and if account is PDT-restricted. Wash sale: Detects 30-day repurchase of same security after a loss. Settlement: Calculates next business day settlement date.","inputSchema":{"type":"object","properties":{"check_type":{"type":"string","enum":["day_trade","wash_sale","settlement","pdt_status"],"description":"Type of compliance check"},"entry_time":{"type":"string","description":"Entry timestamp ISO format (for day_trade check)"},"exit_time":{"type":"string","description":"Exit timestamp ISO format (for day_trade check)"},"symbol":{"type":"string","description":"Symbol (for wash_sale check)"},"loss_date":{"type":"string","description":"Loss date ISO format (for wash_sale check)"},"loss_amount":{"type":"string","description":"Loss amount as negative number (for wash_sale check)"},"subsequent_purchases":{"type":"array","items":{"type":"object","properties":{"symbol":{"type":"string"},"date":{"type":"string"},"quantity":{"type":"string"}},"required":["symbol","date","quantity"]},"description":"Purchases to check against (for wash_sale check)"},"trade_date":{"type":"string","description":"Trade date ISO format (for settlement check)"},"day_trades_count":{"type":"integer","description":"Day trades in last 5 business days (for pdt_status check)"},"account_equity":{"type":"string","description":"Account equity (for pdt_status check)"}},"required":["check_type"]}},{"name":"build_options_plan","description":"Build a complete options trade plan: given an option quote, equity, and risk parameters, returns optimal contract count, max loss, max gain, breakeven, risk/reward ratio, and Greeks snapshot. Supports 3 sizing modes: equity_risk, premium, delta_adjusted. Outputs a structured planning output with warnings.","inputSchema":{"type":"object","properties":{"equity":{"type":"string","description":"Account equity (e.g. '100000')"},"risk_pct":{"type":"string","description":"Risk per trade as decimal (e.g. '0.01' for 1%)"},"option":{"type":"object","properties":{"symbol":{"type":"string"},"underlying_symbol":{"type":"string"},"strike":{"type":"string"},"expiration":{"type":"string"},"option_type":{"type":"string","enum":["CALL","PUT"]},"bid":{"type":"string"},"ask":{"type":"string"},"last":{"type":"string"},"volume":{"type":"integer"},"open_interest":{"type":"integer"},"implied_volatility":{"type":"string"},"delta":{"type":"string"},"gamma":{"type":"string"},"theta":{"type":"string"},"vega":{"type":"string"},"rho":{"type":"string"}},"required":["symbol","underlying_symbol","strike","expiration","option_type","bid","ask","last","volume","open_interest","implied_volatility"],"description":"Option quote to plan around"},"sizing_mode":{"type":"string","enum":["equity_risk","premium","delta_adjusted"],"description":"Sizing mode (default 'equity_risk'). Optional."},"stop_premium":{"type":"string","description":"Stop loss premium level (required for equity_risk and delta_adjusted modes)"},"underlying_price":{"type":"string","description":"Current underlying price (e.g. '500.00')"}},"required":["equity","risk_pct","option","underlying_price"]}},{"name":"build_futures_plan","description":"Build a complete futures trade plan: given contract specs, equity, and risk parameters, returns optimal contract count, max loss, breakeven, ticks to stop, margin requirement, and risk/reward ratio. Supports 3 sizing modes: margin_based, tick_value, notional. Outputs a structured planning output with roll date and warnings.","inputSchema":{"type":"object","properties":{"equity":{"type":"string","description":"Account equity (e.g. '100000')"},"risk_pct":{"type":"string","description":"Risk per trade as decimal (e.g. '0.01' for 1%)"},"symbol":{"type":"string","description":"Futures symbol (e.g. 'ESH26')"},"underlying_symbol":{"type":"string","description":"Root symbol (e.g. 'ES')"},"entry_price":{"type":"string","description":"Planned entry price"},"stop_price":{"type":"string","description":"Stop loss price"},"direction":{"type":"string","enum":["LONG","SHORT"],"description":"Trade direction"},"contract_multiplier":{"type":"integer","description":"Contract multiplier (e.g. 50 for ES)"},"tick_size":{"type":"string","description":"Minimum price increment (e.g. '0.25')"},"tick_value":{"type":"string","description":"Dollar value per tick (e.g. '12.50')"},"initial_margin":{"type":"string","description":"Per-contract initial margin"},"expiration":{"type":"string","description":"Contract expiration date ISO format"},"sizing_mode":{"type":"string","enum":["margin_based","tick_value","notional"],"description":"Sizing mode (default 'tick_value'). Optional."},"available_margin":{"type":"string","description":"Available margin (required for margin_based mode)"},"max_notional":{"type":"string","description":"Maximum notional (required for notional mode)"}},"required":["equity","risk_pct","symbol","underlying_symbol","entry_price","stop_price","direction","contract_multiplier","tick_size","tick_value","initial_margin","expiration"]}},{"name":"calculate_equity_curve","description":"Calculate equity curve from R-multiples: given a list of R-multiple trade results, starting equity, and risk per trade, returns the full equity curve with per-trade equity, drawdown, peak tracking, total return, and max drawdown. Visualizes how G (geometric growth) compounds over time.","inputSchema":{"type":"object","properties":{"r_multiples":{"type":"array","items":{"type":"string"},"description":"List of R-multiple trade results (e.g. ['1.5', '-1.0', '2.3'])"},"starting_equity":{"type":"string","description":"Starting account equity (e.g. '100000')"},"risk_per_trade":{"type":"string","description":"Risk fraction per trade (e.g. '0.01' for 1%). Default '0.01'. Optional."}},"required":["r_multiples","starting_equity"]}},{"name":"score_signal","description":"Score a trading signal's confidence and quality. Confidence (0.50-1.00) measures probability the signal is correct based on conditions met, regime alignment, indicator confluence, and volume confirmation. Quality (0-100) measures trade setup quality based on risk/reward ratio, entry clarity, stop clarity, and regime strength. Returns both scores with pass/fail status.","inputSchema":{"type":"object","properties":{"conditions_met":{"type":"integer","description":"Number of scanner conditions that triggered"},"total_conditions":{"type":"integer","description":"Total conditions the scanner checks"},"regime_aligned":{"type":"boolean","description":"Whether signal aligns with current regime"},"indicator_confluence":{"type":"integer","description":"Number of indicators agreeing (0-5+)"},"volume_confirmed":{"type":"boolean","description":"Whether volume confirms the signal"},"risk_reward_ratio":{"type":"string","description":"Reward divided by risk (e.g. '2.5')"},"entry_clarity":{"type":"string","description":"How tight the entry zone is (0.0-1.0). Default '0.70'. Optional."},"stop_clarity":{"type":"string","description":"How clear the stop level is (0.0-1.0). Default '0.80'. Optional."},"regime_strength":{"type":"string","description":"How strong the current regime is (0.0-1.0). Default '0.50'. Optional."}},"required":["conditions_met","total_conditions","regime_aligned","indicator_confluence","volume_confirmed","risk_reward_ratio"]}},{"name":"analyze_trade_outcome","description":"Analyze a closed trade's outcome vs expectations: determines WIN/LOSS/BREAKEVEN, calculates edge captured (actual R minus expected value), efficiency score (realized R / max potential R from MFE), R left on table, max potential R, highest target hit, and expectation accuracy.","inputSchema":{"type":"object","properties":{"realized_pnl":{"type":"string","description":"Net realized P&L in dollars (e.g. '500.00' or '-200.00')"},"realized_r":{"type":"string","description":"Actual R-multiple achieved (e.g. '1.5' or '-0.8')"},"mfe":{"type":"string","description":"Maximum favorable excursion in dollars"},"one_r_dollars":{"type":"string","description":"Dollar value of 1R (risk amount)"},"expected_value_r":{"type":"string","description":"Expected value in R per trade. Optional."},"expected_avg_win_r":{"type":"string","description":"Historical average win in R. Optional."},"expected_avg_loss_r":{"type":"string","description":"Historical average loss in R (positive). Optional."},"tp1_hit":{"type":"boolean","description":"Whether TP1 was hit. Default false. Optional."},"tp2_hit":{"type":"boolean","description":"Whether TP2 was hit. Default false. Optional."},"tp3_hit":{"type":"boolean","description":"Whether TP3 was hit. Default false. Optional."}},"required":["realized_pnl","realized_r","mfe","one_r_dollars"]}},{"name":"calculate_margin","description":"Calculate margin requirement and buying power used for a position. Supports stocks, ETFs, and options with Reg-T margin rules. Long stocks/ETFs: 50% margin. Short stocks: 150%. Options: full premium. Cash accounts: 100% of notional.","inputSchema":{"type":"object","properties":{"notional":{"type":"string","description":"Position notional value in dollars (e.g. '50000')"},"asset_class":{"type":"string","enum":["STOCK","ETF","OPTION"],"description":"Asset class"},"direction":{"type":"string","enum":["LONG","SHORT"],"description":"Trade direction"},"account_type":{"type":"string","enum":["CASH","MARGIN"],"description":"Account type. Default 'MARGIN'. Optional."}},"required":["notional","asset_class","direction"]}},{"name":"evaluate_scanner","description":"Evaluate scanner rules against market data: runs technical conditions (RSI, MACD, SMA, ADX, Bollinger Bands, volume) against a set of symbols and returns matching scan results with confidence, quality score, suggested entry/stop/target levels, and direction. Supports 11 built-in technical conditions.","inputSchema":{"type":"object","properties":{"scanner_config":{"type":"object","properties":{"scanner_id":{"type":"string","description":"Scanner identifier"},"name":{"type":"string","description":"Scanner name"},"scanner_type":{"type":"string","enum":["TECHNICAL","FUNDAMENTAL","SENTIMENT","CUSTOM"],"description":"Scanner type (default 'TECHNICAL')"},"symbols":{"type":"array","items":{"type":"string"},"description":"Symbols to scan"},"timeframes":{"type":"array","items":{"type":"string"},"description":"Timeframes (e.g. ['1h', '4h'])"},"conditions":{"type":"array","items":{"type":"string"},"description":"Conditions to check. Valid: rsi_oversold, rsi_overbought, macd_bullish_cross, macd_bearish_cross, price_above_sma_20, price_below_sma_20, price_above_sma_50, price_below_sma_50, adx_trending, bb_squeeze, volume_spike"},"min_confidence":{"type":"string","description":"Minimum confidence threshold (0-1). Default '0.6'."},"regime_filter":{"type":"array","items":{"type":"string"},"description":"Only match symbols in these regimes. Optional."}},"required":["scanner_id","name","conditions"],"description":"Scanner configuration"},"market_data":{"type":"object","description":"Market data keyed by symbol. Each entry has: indicators (dict of indicator_name -> value), current_price (string), regime (string), atr (string)","additionalProperties":{"type":"object","properties":{"indicators":{"type":"object"},"current_price":{"type":"string"},"regime":{"type":"string"},"atr":{"type":"string"}},"required":["indicators","current_price","atr"]}}},"required":["scanner_config","market_data"]}},{"name":"record_trade_outcome","description":"Record a completed trade in your agent's journal. Stores symbol, direction, prices, R-multiple, and P&L. R-multiple and P&L are auto-computed from prices if not provided. Recorded trades auto-feed into pre_trade_gate (system health) and trust scores.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol (e.g. 'AAPL')"},"direction":{"type":"string","enum":["long","short"],"description":"Trade direction"},"entry_price":{"type":"string","description":"Entry price (e.g. '185.50')"},"exit_price":{"type":"string","description":"Exit price (e.g. '192.00')"},"stop_price":{"type":"string","description":"Stop loss price (e.g. '180.00')"},"quantity":{"type":"string","description":"Trade quantity (e.g. '100')"},"r_multiple":{"type":"string","description":"Pre-computed R-multiple (auto-computed from prices if omitted)"},"pnl":{"type":"string","description":"Pre-computed P&L (auto-computed from prices and quantity if omitted)"},"trade_date":{"type":"string","description":"Trade date in ISO format (e.g. '2024-03-15'). Optional."},"notes":{"type":"string","description":"Optional notes about the trade"}},"required":["symbol","direction","entry_price","exit_price","stop_price","quantity"]}},{"name":"capture_closed_trade","description":"Capture a closed trade from chat narrative into the data-layer trade_records table. Use this when a user describes a past trade and you need it persisted for behavioral analysis. Supports six asset classes: equities (STOCK), options (OPTION), futures (FUTURE), crypto (CRYPTO), forex (FOREX), prediction markets (PREDICTION_MARKET). Idempotency key is per-class — see asset_class. Distinct from record_trade_outcome (agent journal).","inputSchema":{"type":"object","properties":{"asset_class":{"type":"string","enum":["STOCK","OPTION","FUTURE","CRYPTO","FOREX","PREDICTION_MARKET"],"description":"Asset class of the trade. Determines which fields are required."},"symbol":{"type":"string","description":"Instrument symbol. STOCK: ticker (e.g. 'TSLA'). OPTION: underlying (e.g. 'TSLA'). FUTURE: root (e.g. 'ES'). CRYPTO: pair (e.g. 'BTC-USD'). FOREX: pair (e.g. 'EUR/USD'). PREDICTION_MARKET: free-text label (use market_question for the actual question; symbol can be a short slug)."},"side":{"type":"string","description":"Trade direction. Most classes: 'long' or 'short'. OPTION also accepts 'BTO' / 'STO' / 'BTC' / 'STC'."},"entry_time":{"type":"string","description":"Entry timestamp ISO-8601 (e.g. '2026-04-20T09:30:00Z')."},"entry_price":{"type":"string","description":"Entry price as decimal string. OPTION: premium paid/received. PREDICTION_MARKET: probability 0.0-1.0."},"exit_time":{"type":"string","description":"Exit timestamp ISO-8601 (must follow entry_time)."},"exit_price":{"type":"string","description":"Exit price as decimal string. OPTION: closing premium. PREDICTION_MARKET: closing probability or resolution payout."},"size":{"type":"string","description":"Position size as decimal string. STOCK/OPTION/FUTURE: integer (shares/contracts). CRYPTO: units (e.g. '0.05'). FOREX: lots (e.g. '1.0' — also supply lot_size). PREDICTION_MARKET: integer shares."},"stop_price":{"type":"string","description":"Initial stop-loss price as decimal string. Required for FUTURE; optional for STOCK / OPTION / CRYPTO / FOREX. Not used for PREDICTION_MARKET."},"option_type":{"type":"string","enum":["call","put","CALL","PUT","C","P"],"description":"OPTION only — call or put."},"strike_price":{"type":"string","description":"OPTION only — strike price as decimal string."},"expiration_date":{"type":"string","description":"OPTION only — expiration date ISO-8601 (YYYY-MM-DD)."},"contract_month":{"type":"string","description":"FUTURE only — contract month/year (e.g. '2026-03' or 'MAR26')."},"contract_multiplier":{"type":"string","description":"FUTURE only — point value (e.g. '50' for ES). PnL math uses points × multiplier × contracts."},"exchange":{"type":"string","description":"CRYPTO optional — venue (e.g. 'coinbase', 'binance'). Same pair on different exchanges is a distinct trade for idempotency."},"lot_size":{"type":"string","description":"FOREX required — lot size as decimal (0.01 micro, 0.1 mini, 1.0 standard)."},"market_question":{"type":"string","description":"PREDICTION_MARKET required — full text of the market question."},"platform":{"type":"string","description":"PREDICTION_MARKET required — venue (e.g. 'polymarket', 'kalshi')."},"outcome_predicted":{"type":"string","description":"PREDICTION_MARKET required — the outcome bet on (e.g. 'yes', 'no', or specific outcome label)."},"resolution_state":{"type":"string","enum":["pending","resolved_yes","resolved_no","cancelled"],"description":"PREDICTION_MARKET required — current resolution state."},"strategy":{"type":"string","description":"Optional strategy name (e.g. 'momentum', 'orb_breakout')."},"regime":{"type":"string","enum":["TRENDING_UP","TRENDING_DOWN","RANGING","VOLATILE"],"description":"Optional market regime at entry."},"pnl":{"type":"string","description":"Optional realized P&L (auto-computed from prices * size if omitted)."},"r_multiple":{"type":"string","description":"Optional realized R-multiple (auto-computed from prices/stop if omitted)."},"notes":{"type":"string","description":"Optional free-form notes about the trade."}},"required":["asset_class","symbol","side","entry_time","entry_price","exit_time","exit_price","size"]}},{"name":"get_trade_logs","description":"Read the current user's saved Trade Logs from the data-layer trade_records table. Use when the user asks about their journal, recent trades, trade history, or needs analysis grounded in their own logged trades. Supports filters for symbol, asset_class, state, and limit.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Optional symbol filter, e.g. TSLA, BTC-USD, EUR/USD."},"asset_class":{"type":"string","enum":["STOCK","ETF","OPTION","FUTURE","INDEX","FOREX","CRYPTO","COMMODITY","BOND","VOLATILITY","PREDICTION_MARKET"],"description":"Optional asset class filter."},"state":{"type":"string","enum":["PENDING","OPEN","AT_BE","SCALING","CLOSING","CLOSED"],"description":"Optional trade lifecycle state filter."},"limit":{"type":"integer","description":"Maximum records to return. Default 50, maximum 200."}},"required":[]}},{"name":"get_trade_metrics","description":"Read performance metrics computed from the current user's saved Trade Logs. Use when the user asks about performance review, Trade Metrics, journal stats, expectancy, win rate, R-multiples, segments, or edge quality.","inputSchema":{"type":"object","properties":{},"required":[]}},{"name":"store_memory","description":"Store a memory from a trading event, decision, or observation. Supports episodic (what happened), procedural (what worked), and semantic (what it means) memory types.","inputSchema":{"type":"object","properties":{"type":{"type":"string","enum":["episodic","procedural","semantic"],"description":"Memory type: episodic (what happened), procedural (what worked), semantic (what it means)"},"content":{"type":"string","description":"The memory content to store"},"tags":{"type":"array","items":{"type":"string"},"description":"Optional tags for categorization (e.g. ['earnings', 'AAPL', 'gap-up'])"},"importance":{"type":"number","description":"Importance score from 1 (low) to 10 (critical). Default 5.","minimum":1,"maximum":10}},"required":["type","content"]}},{"name":"search_memory","description":"Search stored memories by query text. Returns relevant memories ranked by similarity and recency.","inputSchema":{"type":"object","properties":{"query":{"type":"string","description":"Search query text"},"memory_type":{"type":"string","enum":["episodic","procedural","semantic","all"],"description":"Filter by memory type. Default 'all'."},"limit":{"type":"number","description":"Maximum number of results to return. Default 10."}},"required":["query"]}},{"name":"get_trading_biases","description":"Analyze trading history for cognitive biases. Detects loss aversion, recency bias, anchoring, disposition effect, overconfidence, and confirmation bias.","inputSchema":{"type":"object","properties":{"trades":{"type":"array","items":{"type":"object","properties":{"entry_price":{"type":"number","description":"Entry price"},"exit_price":{"type":"number","description":"Exit price"},"direction":{"type":"string","enum":["long","short"],"description":"Trade direction"},"hold_time_hours":{"type":"number","description":"How long the trade was held in hours"},"pnl":{"type":"number","description":"Realized P&L in dollars"}},"required":["entry_price","exit_price","direction","hold_time_hours","pnl"]},"description":"Array of trade objects to analyze for biases"}},"required":["trades"]}},{"name":"get_behavioral_fingerprint","description":"Generate a behavioral fingerprint from trading patterns. Identifies tendencies in timing, sizing, risk tolerance, and strategy preferences.","inputSchema":{"type":"object","properties":{"trades":{"type":"array","items":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol"},"direction":{"type":"string","enum":["long","short"],"description":"Trade direction"},"entry_price":{"type":"number","description":"Entry price"},"exit_price":{"type":"number","description":"Exit price"},"size":{"type":"number","description":"Position size (shares/contracts)"},"timestamp":{"type":"string","description":"ISO datetime of trade entry"}},"required":["symbol","direction","entry_price","exit_price","size","timestamp"]},"description":"Array of trade objects to fingerprint"}},"required":["trades"]}},{"name":"predict_trajectory","description":"Predict future equity curve trajectory using Monte Carlo simulation with regime-aware modeling.","inputSchema":{"type":"object","properties":{"equity_values":{"type":"array","items":{"type":"number"},"description":"Historical equity values (e.g. [100000, 101500, 99800, 103200])"},"timestamps":{"type":"array","items":{"type":"string"},"description":"ISO datetime strings for each equity value. Optional."},"horizon_days":{"type":"number","description":"Number of days to project forward. Default 30."},"simulations":{"type":"number","description":"Number of Monte Carlo simulations. Default 1000."}},"required":["equity_values"]}},{"name":"detect_anomalies","description":"Detect anomalous trades or returns in a dataset. Uses statistical methods to identify outliers and unusual patterns.","inputSchema":{"type":"object","properties":{"values":{"type":"array","items":{"type":"number"},"description":"Array of numeric values to analyze (e.g. returns, P&L, R-multiples)"},"labels":{"type":"array","items":{"type":"string"},"description":"Optional labels for each value (e.g. trade IDs, dates)"},"sensitivity":{"type":"number","description":"Sensitivity from 1 (few anomalies) to 10 (many anomalies). Default 5.","minimum":1,"maximum":10}},"required":["values"]}},{"name":"cluster_trades","description":"Cluster trades by similarity to identify distinct trading patterns or strategy regimes.","inputSchema":{"type":"object","properties":{"trades":{"type":"array","items":{"type":"object","properties":{"r_multiple":{"type":"number","description":"R-multiple of the trade"},"hold_time":{"type":"number","description":"Hold time in hours"},"direction":{"type":"string","enum":["long","short"],"description":"Trade direction"},"volatility":{"type":"number","description":"Volatility at time of trade (e.g. ATR or implied vol)"}},"required":["r_multiple","hold_time","direction","volatility"]},"description":"Array of trade objects to cluster"},"n_clusters":{"type":"number","description":"Number of clusters to form. Default 3."}},"required":["trades"]}},{"name":"get_stock_quote","description":"Get a real-time stock quote for a symbol. Returns current price, change, volume, high, low, open, and previous close. Use this whenever the user mentions a specific ticker or asks about a stock's price. Uses canonical market data only; search/news providers are not used for numeric prices. Successful market-data responses are billed at the flat $0.030 listed.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Ticker symbol (e.g. 'AAPL', 'NVDA', 'SPY')"},"asset_class":{"type":"string","enum":["equity"],"description":"Must be 'equity'. The handler refuses other values and points the planner to get_ohlcv (crypto/forex/commodity pair-form symbols)."}},"required":["symbol","asset_class"]}},{"name":"get_market_quote","description":"Get a canonical market quote for a non-equity instrument (crypto, forex, commodity, index, or futures symbol). Use this before falling back to historical-bar proxies when the user asks for live or current non-stock market data. Accepts TwelveData-style symbols such as BTC/USD, EUR/USD, XAU/USD, ES, or SPX. Search/news providers are not used for numeric prices. Successful market-data responses are billed at the flat $0.030 listed.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Market symbol or pair (e.g. 'BTC/USD', 'EUR/USD', 'XAU/USD', 'SPX', 'ES')"},"asset_class":{"type":"string","enum":["crypto","forex","commodity","commodities","futures","future","index","cfd"],"description":"Optional market family used only for symbol normalization."}},"required":["symbol"]}},{"name":"get_commodity_quote","description":"Get a current spot quote for a commodity. Use this for commodity pricing queries (gold, silver, platinum, palladium, oil / WTI, Brent, copper, natural gas) instead of get_stock_quote. Accepts a free-form commodity name or ticker; the handler normalizes (\"gold\" → \"XAU/USD\", \"oil\" → \"WTI/USD\", etc.) and routes through canonical market data only. Search/news providers are not used for numeric commodity prices. Successful market-data responses are billed at the flat $0.030 listed.","inputSchema":{"type":"object","properties":{"commodity":{"type":"string","description":"Commodity name or ticker (e.g. 'gold', 'silver', 'oil', 'WTI', 'Brent', 'copper', 'natural gas', 'XAU/USD')"}},"required":["commodity"]}},{"name":"get_ohlcv","description":"Get historical OHLCV bars for a symbol at a specified timeframe (1m, 5m, 15m, 30m, 45m, 1h, 2h, 4h, 8h, 1d, 1w, 1mo). Use this when the user asks for price history, chart data, candles, bars, or 'last N days/weeks of data'. Returns list of OHLCV records with timestamp, open, high, low, close, volume.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Ticker symbol (e.g. AAPL, BTC/USD)"},"timeframe":{"type":"string","enum":["1m","5m","15m","30m","45m","1h","2h","4h","8h","1d","1w","1mo"],"description":"Bar interval"},"from_date":{"type":"string","format":"date","description":"ISO date YYYY-MM-DD (inclusive)"},"to_date":{"type":"string","format":"date","description":"ISO date YYYY-MM-DD (inclusive)"}},"required":["symbol","timeframe","from_date","to_date"]}},{"name":"get_options_chain","description":"Get the options chain for a symbol, optionally filtered by expiration date. Returns list of option contracts with strike, expiration, type (call/put), bid, ask, volume, open interest, implied volatility. Use this when the user asks for options chain, options data, calls/puts at strikes, or options pricing.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Underlying ticker symbol"},"expiration":{"type":"string","format":"date","description":"Optional ISO date YYYY-MM-DD; if omitted, returns all expirations"}},"required":["symbol"]}},{"name":"get_fundamentals","description":"Get company fundamentals for a symbol: P/E ratio, EPS, market cap, beta, dividend yield, sector, industry, employee count, and business description. Use this when the user asks about valuation, P/E, EPS, market cap, sector, industry, or fundamentals comparisons across symbols. Routes through TwelveData /statistics + /profile in parallel. Returns fields as null when the upstream provider does not cover them for the given symbol (ETFs lack P/E, some ADRs lack dividend yield).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Ticker symbol (e.g. 'TSLA', 'AAPL', 'NVDA')"}},"required":["symbol"]}},{"name":"get_market_movers","description":"Get today's top market movers — gainers, losers, or most active stocks. Use this when the user asks what's buzzing, moving, hot, or where the opportunities are. Returns ranked list with price and change percent. Uses scanner/canonical market data only; search/news providers are not used for numeric movers. Successful market-data responses are billed at the flat $0.030 listed.","inputSchema":{"type":"object","properties":{"category":{"type":"string","enum":["gainers","losers","active"],"description":"Mover category (default 'gainers')"},"limit":{"type":"integer","description":"Number of movers to return (default 10, max 25)","minimum":1,"maximum":25}}}},{"name":"get_market_overview","description":"Get a broad market overview — major indices (SPY, QQQ, DIA, IWM), market regime, VIX level, and top movers. Use this when the user asks how the market is doing, wants a market summary, or asks about sectors. No parameters required. Uses canonical market data only for numeric fields; use search_news separately for narrative catalysts. Successful market-data responses are billed at the flat $0.030 listed.","inputSchema":{"type":"object","properties":{}}},{"name":"search_news","description":"Search for recent financial news and market events. Use this when the user asks about earnings, news, events, or sentiment for a stock or topic. Returns headlines, snippets, and links. Premium research-provider responses are billed at live wholesale markup; standard search responses are billed at the flat $0.030 listed.","inputSchema":{"type":"object","properties":{"query":{"type":"string","description":"Search query (e.g. 'AAPL earnings', 'Fed rate decision', 'NVDA news')"},"limit":{"type":"integer","description":"Number of results to return (default 5, max 10)","minimum":1,"maximum":10}},"required":["query"]}},{"name":"scan_market","description":"Run a full market scan — regime detection, top movers, and watchlist analysis. Use this when the user wants a comprehensive market read, asks 'show me everything', or wants to find setups across the market. Forces a fresh scan regardless of cache age. Uses scanner/canonical market data only for numeric scan fields; use search_news separately for narrative catalysts. Successful scanner responses are billed at the flat $0.030 listed.","inputSchema":{"type":"object","properties":{"focus":{"type":"string","enum":["all","equities","crypto","forex"],"description":"Market focus area (default 'all')"}}}},{"name":"get_alerts","description":"Get active proactive alerts for the user. Returns regime change warnings, earnings proximity alerts, position risk flags, and volatility spikes. Use this when the user asks about alerts, warnings, or 'anything I should know'.","inputSchema":{"type":"object","properties":{"include_dismissed":{"type":"boolean","description":"Include dismissed alerts in results (default false)"},"limit":{"type":"integer","description":"Max number of alerts to return (default 20)"}}}},{"name":"dismiss_alert","description":"Dismiss a proactive alert by ID. Use this after the user has acknowledged an alert or taken action on it. The alert will no longer appear in active alerts.","inputSchema":{"type":"object","properties":{"alert_id":{"type":"string","description":"The alert ID to dismiss"}},"required":["alert_id"]}},{"name":"delegate_task","description":"Delegate a task to a specialist agent. System R finds the best available agent for the requested role and submits the delegation. Use this when the user's request would benefit from a specialist: 'have the risk analyst check that', 'get a position sizing recommendation', 'ask the market scanner'. Returns a delegation_id to track progress.","inputSchema":{"type":"object","properties":{"role":{"type":"string","enum":["risk_analyst","market_scanner","position_sizer","trade_analyst"],"description":"Specialist role to delegate to"},"task_description":{"type":"string","description":"Description of the task for the delegate agent"},"input_data":{"type":"object","description":"Optional structured input data for the delegate"},"priority":{"type":"string","enum":["normal","high","critical"],"description":"Task priority (default 'normal')"}},"required":["role","task_description"]}},{"name":"list_agents","description":"List all active agents and their capabilities. Use this to see which specialist agents are available for delegation. Returns agent IDs, states, and whether they are alive.","inputSchema":{"type":"object","properties":{}}},{"name":"get_delegation_status","description":"Check the status of a delegation by ID. Returns the current state (pending, accepted, in_progress, completed, failed, rejected, cancelled), result data if completed, and error message if failed.","inputSchema":{"type":"object","properties":{"delegation_id":{"type":"string","description":"The delegation ID to check"}},"required":["delegation_id"]}},{"name":"cancel_delegation","description":"Cancel an in-flight delegation. Only works if the delegation has not yet reached a terminal state (completed, failed, rejected, cancelled).","inputSchema":{"type":"object","properties":{"delegation_id":{"type":"string","description":"The delegation ID to cancel"}},"required":["delegation_id"]}},{"name":"create_agent","description":"Create a new specialist agent. Available roles: risk_analyst (monitors portfolio risk and drawdown), market_scanner (identifies trade setups and scans for opportunities), position_sizer (calculates optimal position sizes for trades), trade_analyst (analyzes trade history and performance).","inputSchema":{"type":"object","properties":{"role":{"type":"string","enum":["risk_analyst","market_scanner","position_sizer","trade_analyst"],"description":"Specialist role for the new agent"},"name":{"type":"string","description":"Optional display name for the agent"}},"required":["role"]}},{"name":"list_capabilities","description":"Show all System R capabilities organized by category. Use this when the user asks 'what can you do', 'show me everything', 'what tools are available', or 'help me explore'. Returns all tool categories with descriptions. Free.","inputSchema":{"type":"object","properties":{}}},{"name":"http_fetch","description":"Fetch a public HTTPS URL via GET. Use for public APIs or pages not covered by dedicated capabilities. Returns body text (<=1MB), status code, and content type. HTTPS only; private IPs and non-443 ports are blocked. Use this when no pre-built capability covers your information need.","inputSchema":{"type":"object","properties":{"url":{"type":"string","description":"HTTPS URL to fetch."},"accept":{"type":"string","description":"Optional Accept header (e.g. application/json). Default allows JSON + text."}},"required":["url"]}},{"name":"search_capabilities","description":"Search the agent's Capability Registry by natural-language intent. Use this when you need to discover which capabilities are available for a task you're uncertain about. Returns a ranked list with layer, side-effect, description, and asset classes per match. Deterministic scoring (no LLM call), cheap and fast — use liberally during planning.","inputSchema":{"type":"object","properties":{"intent":{"type":"string","description":"Natural-language description of what you need."},"limit":{"type":"integer","description":"Max matches to return (1-50). Default 10.","minimum":1,"maximum":50}},"required":["intent"]}},{"name":"describe_capability","description":"Return full schema + metadata for a named capability. Use when you have a capability name but need its input_schema, required parameters, asset_classes, or requires_user_approval flag. Cheap lookup, no LLM call.","inputSchema":{"type":"object","properties":{"name":{"type":"string","description":"The capability name (e.g. 'get_stock_quote')."}},"required":["name"]}},{"name":"get_realtime_quotes_status","description":"Return a diagnostic snapshot of the realtime quotes WebSocket streaming surface (Slice 6 Session 16). Read-only — does NOT subscribe or unsubscribe. Reports connection state, generation counter, active subscription count, per-symbol last-tick timestamp / last-price / 60-second tick-received / tick-dropped counters, and last subscribe-status failures. Returns connection_state='unconfigured' when no TwelveData key is set in the environment. Pure-read of local adapter state.","inputSchema":{"type":"object","properties":{"symbols":{"type":"array","items":{"type":"string"},"description":"Optional. When supplied, restrict the per-symbol subscriptions array to these symbols. Symbols are normalized (trim + upper-case) before filtering."}}}},{"name":"lookup_internal_data","description":"Query internal data repositories by typed query_type. Returns user-scoped data (workspace, preferences, trajectory history) with ownership enforced at the data-access boundary. Call list_internal_query_types first to see available types.","inputSchema":{"type":"object","properties":{"query_type":{"type":"string"},"params":{"type":"object"}},"required":["query_type"]}},{"name":"list_internal_query_types","description":"Return all query_type values available to lookup_internal_data, with required/optional params per type. Call this when you need to discover what internal queries are available.","inputSchema":{"type":"object","properties":{}}},{"name":"python_eval","description":"Run Python code in a sandboxed subprocess for custom math, data transforms, and derivations on existing observations. NO filesystem, NO network, NO environment access. Available: math, statistics, decimal, fractions, cmath, datetime, json, re, itertools, functools, collections, typing; numpy (as np), pandas (as pd), scipy.stats (as scipy_stats) when installed. 5-second CPU limit, 256MB RAM limit, 100KB output limit. Import statements are rejected — all allowed modules are pre-imported into globals. Pass data via the `inputs` param (JSON-serializable) and set a variable named `result` to return a value. Use for: custom calculations (Sharpe, drawdown, correlations), data aggregations, format conversions, statistical summaries. Do NOT use for: network requests (use http_fetch), file access (not available), stateful computation (no persistence between calls).","inputSchema":{"type":"object","properties":{"code":{"type":"string","description":"Python code to execute."},"inputs":{"type":"object","description":"JSON-serializable data accessible inside the sandbox as the `inputs` dict."},"timeout_seconds":{"type":"integer","minimum":1,"maximum":10,"description":"Max CPU seconds (default 5)."}},"required":["code"]}},{"name":"get_attachment_rows","description":"Query rows from a tabular attachment by raw_handle. The handle comes from the attachment digest in your prompt. Use this when the digest names columns/rows you need to inspect — do NOT ask the user to paste rows. Cheap (free), pure read; safe to call multiple times across one turn. Filter is a list of {col, op, value} predicates ANDed together. Supported ops: =, !=, <, >, <=, >=, in, contains. Returns rows + total_matched + has_more so you can paginate. Default limit 50; hard cap 500.","inputSchema":{"type":"object","properties":{"raw_handle":{"type":"string","description":"Opaque handle from the digest (e.g. att_<user>_<session>_<turn>_<idx>)."},"filter":{"type":"array","description":"Optional list of column predicates ANDed together. Empty / omitted means match-all.","items":{"type":"object","properties":{"col":{"type":"string"},"op":{"type":"string","enum":["=","!=","<",">","<=",">=","in","contains"]},"value":{}},"required":["col","op","value"]}},"columns":{"type":"array","items":{"type":"string"},"description":"Optional projection. Defaults to all columns."},"sort_by":{"type":"string","description":"Optional column to sort by, ascending. Prefix with '-' for descending (e.g. '-pnl')."},"limit":{"type":"integer","minimum":1,"maximum":500,"description":"Max rows to return. Default 50."},"offset":{"type":"integer","minimum":0,"description":"Skip first N matched rows. Default 0."}},"required":["raw_handle"]}},{"name":"calculate_indicators_crypto","description":"Compute RSI, ATR, moving averages, and other technical indicators for a cryptocurrency instrument. Returns a dict of indicator name to value. Requires `symbol` and `bars` (list of OHLCV dicts, chronological order, 20+ bars recommended).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol (e.g. the ticker or contract identifier for the cryptocurrency)."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}}},"required":["symbol","bars"]}},{"name":"classify_regime_crypto","description":"Classify the current market regime for a cryptocurrency instrument from recent bars. Returns a dict with `regime` (e.g. TRENDING_UP, TRENDING_DOWN, RANGING, HIGH_VOLATILITY) and `confidence` (0.00 to 1.00). Requires `symbol` and `bars`.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the cryptocurrency."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}},"lookback":{"type":"integer","description":"Reserved for future use; currently ignored. Regime classification uses the full bar window provided."}},"required":["symbol","bars"]}},{"name":"generate_signals_crypto","description":"Generate entry/exit signals for a cryptocurrency instrument from pre-computed indicators. Returns a list of signal dicts (type, direction, reason, confidence). Requires `symbol` and `indicators` (typically the output of calculate_indicators_crypto).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the cryptocurrency."},"indicators":{"type":"object","description":"Dict of indicator name to value (string or number). Typically the `indicators` field from calculate_indicators_<asset>."},"regime":{"type":"string","description":"Optional regime label from classify_regime_<asset>. Reserved for future use; currently ignored by the intelligence port."}},"required":["symbol","indicators"]}},{"name":"calculate_indicators_forex","description":"Compute RSI, ATR, moving averages, and other technical indicators for a forex pair instrument. Returns a dict of indicator name to value. Requires `symbol` and `bars` (list of OHLCV dicts, chronological order, 20+ bars recommended).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol (e.g. the ticker or contract identifier for the forex pair)."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}}},"required":["symbol","bars"]}},{"name":"classify_regime_forex","description":"Classify the current market regime for a forex pair instrument from recent bars. Returns a dict with `regime` (e.g. TRENDING_UP, TRENDING_DOWN, RANGING, HIGH_VOLATILITY) and `confidence` (0.00 to 1.00). Requires `symbol` and `bars`.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the forex pair."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}},"lookback":{"type":"integer","description":"Reserved for future use; currently ignored. Regime classification uses the full bar window provided."}},"required":["symbol","bars"]}},{"name":"generate_signals_forex","description":"Generate entry/exit signals for a forex pair instrument from pre-computed indicators. Returns a list of signal dicts (type, direction, reason, confidence). Requires `symbol` and `indicators` (typically the output of calculate_indicators_forex).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the forex pair."},"indicators":{"type":"object","description":"Dict of indicator name to value (string or number). Typically the `indicators` field from calculate_indicators_<asset>."},"regime":{"type":"string","description":"Optional regime label from classify_regime_<asset>. Reserved for future use; currently ignored by the intelligence port."}},"required":["symbol","indicators"]}},{"name":"calculate_indicators_equity","description":"Compute RSI, ATR, moving averages, and other technical indicators for a equity instrument. Returns a dict of indicator name to value. Requires `symbol` and `bars` (list of OHLCV dicts, chronological order, 20+ bars recommended).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol (e.g. the ticker or contract identifier for the equity)."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}}},"required":["symbol","bars"]}},{"name":"classify_regime_equity","description":"Classify the current market regime for a equity instrument from recent bars. Returns a dict with `regime` (e.g. TRENDING_UP, TRENDING_DOWN, RANGING, HIGH_VOLATILITY) and `confidence` (0.00 to 1.00). Requires `symbol` and `bars`.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the equity."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}},"lookback":{"type":"integer","description":"Reserved for future use; currently ignored. Regime classification uses the full bar window provided."}},"required":["symbol","bars"]}},{"name":"generate_signals_equity","description":"Generate entry/exit signals for a equity instrument from pre-computed indicators. Returns a list of signal dicts (type, direction, reason, confidence). Requires `symbol` and `indicators` (typically the output of calculate_indicators_equity).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the equity."},"indicators":{"type":"object","description":"Dict of indicator name to value (string or number). Typically the `indicators` field from calculate_indicators_<asset>."},"regime":{"type":"string","description":"Optional regime label from classify_regime_<asset>. Reserved for future use; currently ignored by the intelligence port."}},"required":["symbol","indicators"]}},{"name":"calculate_indicators_fixed_income","description":"Compute RSI, ATR, moving averages, and other technical indicators for a fixed-income instrument. Returns a dict of indicator name to value. Requires `symbol` and `bars` (list of OHLCV dicts, chronological order, 20+ bars recommended).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol (e.g. the ticker or contract identifier for the fixed-income)."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}}},"required":["symbol","bars"]}},{"name":"classify_regime_fixed_income","description":"Classify the current market regime for a fixed-income instrument from recent bars. Returns a dict with `regime` (e.g. TRENDING_UP, TRENDING_DOWN, RANGING, HIGH_VOLATILITY) and `confidence` (0.00 to 1.00). Requires `symbol` and `bars`.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the fixed-income."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}},"lookback":{"type":"integer","description":"Reserved for future use; currently ignored. Regime classification uses the full bar window provided."}},"required":["symbol","bars"]}},{"name":"generate_signals_fixed_income","description":"Generate entry/exit signals for a fixed-income instrument from pre-computed indicators. Returns a list of signal dicts (type, direction, reason, confidence). Requires `symbol` and `indicators` (typically the output of calculate_indicators_fixed_income).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the fixed-income."},"indicators":{"type":"object","description":"Dict of indicator name to value (string or number). Typically the `indicators` field from calculate_indicators_<asset>."},"regime":{"type":"string","description":"Optional regime label from classify_regime_<asset>. Reserved for future use; currently ignored by the intelligence port."}},"required":["symbol","indicators"]}},{"name":"calculate_indicators_commodity","description":"Compute RSI, ATR, moving averages, and other technical indicators for a commodity instrument. Returns a dict of indicator name to value. Requires `symbol` and `bars` (list of OHLCV dicts, chronological order, 20+ bars recommended).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol (e.g. the ticker or contract identifier for the commodity)."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}}},"required":["symbol","bars"]}},{"name":"classify_regime_commodity","description":"Classify the current market regime for a commodity instrument from recent bars. Returns a dict with `regime` (e.g. TRENDING_UP, TRENDING_DOWN, RANGING, HIGH_VOLATILITY) and `confidence` (0.00 to 1.00). Requires `symbol` and `bars`.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the commodity."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}},"lookback":{"type":"integer","description":"Reserved for future use; currently ignored. Regime classification uses the full bar window provided."}},"required":["symbol","bars"]}},{"name":"generate_signals_commodity","description":"Generate entry/exit signals for a commodity instrument from pre-computed indicators. Returns a list of signal dicts (type, direction, reason, confidence). Requires `symbol` and `indicators` (typically the output of calculate_indicators_commodity).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the commodity."},"indicators":{"type":"object","description":"Dict of indicator name to value (string or number). Typically the `indicators` field from calculate_indicators_<asset>."},"regime":{"type":"string","description":"Optional regime label from classify_regime_<asset>. Reserved for future use; currently ignored by the intelligence port."}},"required":["symbol","indicators"]}},{"name":"calculate_indicators_energy","description":"Compute RSI, ATR, moving averages, and other technical indicators for a energy-sector instrument. Returns a dict of indicator name to value. Requires `symbol` and `bars` (list of OHLCV dicts, chronological order, 20+ bars recommended).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol (e.g. the ticker or contract identifier for the energy-sector)."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}}},"required":["symbol","bars"]}},{"name":"classify_regime_energy","description":"Classify the current market regime for a energy-sector instrument from recent bars. Returns a dict with `regime` (e.g. TRENDING_UP, TRENDING_DOWN, RANGING, HIGH_VOLATILITY) and `confidence` (0.00 to 1.00). Requires `symbol` and `bars`.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the energy-sector."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}},"lookback":{"type":"integer","description":"Reserved for future use; currently ignored. Regime classification uses the full bar window provided."}},"required":["symbol","bars"]}},{"name":"generate_signals_energy","description":"Generate entry/exit signals for a energy-sector instrument from pre-computed indicators. Returns a list of signal dicts (type, direction, reason, confidence). Requires `symbol` and `indicators` (typically the output of calculate_indicators_energy).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the energy-sector."},"indicators":{"type":"object","description":"Dict of indicator name to value (string or number). Typically the `indicators` field from calculate_indicators_<asset>."},"regime":{"type":"string","description":"Optional regime label from classify_regime_<asset>. Reserved for future use; currently ignored by the intelligence port."}},"required":["symbol","indicators"]}},{"name":"calculate_indicators_prediction","description":"Compute RSI, ATR, moving averages, and other technical indicators for a prediction-market instrument. Returns a dict of indicator name to value. Requires `symbol` and `bars` (list of OHLCV dicts, chronological order, 20+ bars recommended).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol (e.g. the ticker or contract identifier for the prediction-market)."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}}},"required":["symbol","bars"]}},{"name":"classify_regime_prediction","description":"Classify the current market regime for a prediction-market instrument from recent bars. Returns a dict with `regime` (e.g. TRENDING_UP, TRENDING_DOWN, RANGING, HIGH_VOLATILITY) and `confidence` (0.00 to 1.00). Requires `symbol` and `bars`.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the prediction-market."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}},"lookback":{"type":"integer","description":"Reserved for future use; currently ignored. Regime classification uses the full bar window provided."}},"required":["symbol","bars"]}},{"name":"generate_signals_prediction","description":"Generate entry/exit signals for a prediction-market instrument from pre-computed indicators. Returns a list of signal dicts (type, direction, reason, confidence). Requires `symbol` and `indicators` (typically the output of calculate_indicators_prediction).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the prediction-market."},"indicators":{"type":"object","description":"Dict of indicator name to value (string or number). Typically the `indicators` field from calculate_indicators_<asset>."},"regime":{"type":"string","description":"Optional regime label from classify_regime_<asset>. Reserved for future use; currently ignored by the intelligence port."}},"required":["symbol","indicators"]}},{"name":"calculate_indicators_options","description":"Compute RSI, ATR, moving averages, and other technical indicators for a options instrument. Returns a dict of indicator name to value. Requires `symbol` and `bars` (list of OHLCV dicts, chronological order, 20+ bars recommended).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol (e.g. the ticker or contract identifier for the options)."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}}},"required":["symbol","bars"]}},{"name":"classify_regime_options","description":"Classify the current market regime for a options instrument from recent bars. Returns a dict with `regime` (e.g. TRENDING_UP, TRENDING_DOWN, RANGING, HIGH_VOLATILITY) and `confidence` (0.00 to 1.00). Requires `symbol` and `bars`.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the options."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}},"lookback":{"type":"integer","description":"Reserved for future use; currently ignored. Regime classification uses the full bar window provided."}},"required":["symbol","bars"]}},{"name":"generate_signals_options","description":"Generate entry/exit signals for a options instrument from pre-computed indicators. Returns a list of signal dicts (type, direction, reason, confidence). Requires `symbol` and `indicators` (typically the output of calculate_indicators_options).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the options."},"indicators":{"type":"object","description":"Dict of indicator name to value (string or number). Typically the `indicators` field from calculate_indicators_<asset>."},"regime":{"type":"string","description":"Optional regime label from classify_regime_<asset>. Reserved for future use; currently ignored by the intelligence port."}},"required":["symbol","indicators"]}},{"name":"calculate_indicators_futures","description":"Compute RSI, ATR, moving averages, and other technical indicators for a futures instrument. Returns a dict of indicator name to value. Requires `symbol` and `bars` (list of OHLCV dicts, chronological order, 20+ bars recommended).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol (e.g. the ticker or contract identifier for the futures)."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}}},"required":["symbol","bars"]}},{"name":"classify_regime_futures","description":"Classify the current market regime for a futures instrument from recent bars. Returns a dict with `regime` (e.g. TRENDING_UP, TRENDING_DOWN, RANGING, HIGH_VOLATILITY) and `confidence` (0.00 to 1.00). Requires `symbol` and `bars`.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the futures."},"bars":{"type":"array","description":"Historical OHLCV bars in chronological order. Each element is a dict with timestamp, open, high, low, close, volume. At least 20 bars are recommended; 200 bars unlock longer-horizon indicators.","items":{"type":"object","properties":{"timestamp":{"type":"string","description":"ISO-8601 timestamp of the bar close."},"open":{"type":"string","description":"Open price."},"high":{"type":"string","description":"High price."},"low":{"type":"string","description":"Low price."},"close":{"type":"string","description":"Close price."},"volume":{"type":"string","description":"Volume."}}}},"lookback":{"type":"integer","description":"Reserved for future use; currently ignored. Regime classification uses the full bar window provided."}},"required":["symbol","bars"]}},{"name":"generate_signals_futures","description":"Generate entry/exit signals for a futures instrument from pre-computed indicators. Returns a list of signal dicts (type, direction, reason, confidence). Requires `symbol` and `indicators` (typically the output of calculate_indicators_futures).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol for the futures."},"indicators":{"type":"object","description":"Dict of indicator name to value (string or number). Typically the `indicators` field from calculate_indicators_<asset>."},"regime":{"type":"string","description":"Optional regime label from classify_regime_<asset>. Reserved for future use; currently ignored by the intelligence port."}},"required":["symbol","indicators"]}},{"name":"broker_get_account","description":"Fetch account balances from your connected broker's live feed. Returns equity, cash, buying power, margin used, margin available, and day-trade count. Uses the user's active broker connection; returns a structured error if no broker is connected. No arguments required.","inputSchema":{"type":"object","properties":{}}},{"name":"broker_get_positions","description":"Fetch all current open positions from your connected broker's live feed. Returns a list with symbol, quantity (signed; negative = short), avg entry price, current price, market value, and unrealized P&L for each. No arguments required.","inputSchema":{"type":"object","properties":{}}},{"name":"broker_get_position","description":"Fetch the user's current position for one symbol from your connected broker's live feed. Returns null when the user has no position in that symbol. Requires `symbol`.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol (e.g. 'AAPL', 'BTC-USD')."}},"required":["symbol"]}},{"name":"broker_get_orders","description":"List orders from your connected broker's live feed. Optionally filter by `status` (PENDING / SUBMITTED / PARTIAL / FILLED / CANCELLED / REJECTED) and/or `symbol`. Returns a list with order_id, symbol, side, quantity, filled_quantity, status, and timestamps for each order.","inputSchema":{"type":"object","properties":{"status":{"type":"string","description":"Optional status filter. One of PENDING, SUBMITTED, PARTIAL, FILLED, CANCELLED, REJECTED."},"symbol":{"type":"string","description":"Optional symbol filter."}}}},{"name":"broker_get_order","description":"Fetch one order by ID from your connected broker's live feed. Returns null when the order does not exist on that broker. Requires `order_id`.","inputSchema":{"type":"object","properties":{"order_id":{"type":"string","description":"Broker-issued or internal order ID."}},"required":["order_id"]}},{"name":"broker_get_quote","description":"Fetch a real-time quote for one symbol from your connected broker's live feed. Returns price and timestamp. For public market-data quotes that do not require a connected broker, use `get_stock_quote` instead. Requires `symbol`.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol in the broker's native format."}},"required":["symbol"]}},{"name":"broker_get_bars","description":"Fetch historical OHLCV bars for one symbol from your connected broker's live feed. Returns a list of bars in chronological order. Requires `symbol`, `timeframe` (e.g. '1min', '5min', '1h', '1d'), `start` and `end` ISO-8601 timestamps.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol."},"timeframe":{"type":"string","description":"Bar interval in broker-native format. Common values: '1min', '5min', '15min', '1h', '1d'."},"start":{"type":"string","description":"Start of the window as an ISO-8601 timestamp (e.g. '2026-04-01T00:00:00Z')."},"end":{"type":"string","description":"End of the window as an ISO-8601 timestamp."}},"required":["symbol","timeframe","start","end"]}},{"name":"broker_cancel_order","description":"Cancel a pending order on your connected broker's live feed. Reversible -- can be safely retried with the same `idempotency_key` (or the same canonical args). Returns the cancelled order_id and a boolean confirmation. Requires `order_id`.","inputSchema":{"type":"object","properties":{"order_id":{"type":"string","description":"Broker-issued or internal order ID."},"idempotency_key":{"type":"string","description":"Optional client-supplied dedup key. When present, repeated calls with the same key return the cached result without re-invoking the broker."}},"required":["order_id"]}},{"name":"broker_health","description":"Returns your connected broker's live health: connection status, last successful call timestamp, recent error count, OAuth token expiry, and active subscription count. Read-only local snapshot -- never issues a broker API call.","inputSchema":{"type":"object","properties":{},"required":[]}},{"name":"create_trade_from_plan","description":"Create a trade from an approved TradePlan. Advances a plan into a live Trade record once the entry order has been placed with the broker. Safe to retry (REVERSIBLE_WRITE) -- pass an `idempotency_key` to dedupe exactly, otherwise the content hash is used. Plan ownership is verified before the write; unknown or foreign plan IDs return `error=not_found`.","inputSchema":{"type":"object","properties":{"plan_id":{"type":"string","description":"Plan to promote to a live trade."},"entry_order_id":{"type":"string","description":"Broker-side order ID for the entry fill. Recorded on the Trade for later lookups."},"idempotency_key":{"type":"string","description":"Optional Stripe-style dedup key. If supplied, the same key returns the same result for 10 minutes."}},"required":["plan_id","entry_order_id"]}},{"name":"record_trade_fill","description":"Apply a broker fill to an existing trade and recompute the weighted-average entry price. Safe to retry (REVERSIBLE_WRITE) with the same fill payload. Trade ownership is enforced at the boundary; foreign trade IDs return `error=not_found`.","inputSchema":{"type":"object","properties":{"trade_id":{"type":"string"},"execution":{"type":"object","description":"Fill payload: id, order_id, trade_id, symbol, quantity, price, commission, executed_at (ISO-8601), broker, broker_execution_id."},"idempotency_key":{"type":"string"}},"required":["trade_id","execution"]}},{"name":"close_trade","description":"Close an open trade. The broker-side close is irreversible once sent, but the journal write is reversible -- safe to retry (REVERSIBLE_WRITE). Pass an `exit_price` to submit a limit order; omit for market. Trade ownership is enforced; foreign trade IDs return `error=not_found`.","inputSchema":{"type":"object","properties":{"trade_id":{"type":"string"},"exit_reason":{"type":"string","description":"ExitReason enum value. Defaults to MANUAL."},"exit_price":{"type":"string","description":"Optional Decimal limit price. Omit for market."},"idempotency_key":{"type":"string"}},"required":["trade_id"]}},{"name":"update_trade_targets","description":"Check take-profit target levels for an open trade against the current price. When targets are hit, scales out the appropriate percentage (TP1: 50%, TP2: 30%, TP3: 20% by default) and closes the final tranche. Safe to retry (REVERSIBLE_WRITE). Returns the next unreached target when no hits. Trade ownership is enforced; foreign trade IDs return `error=not_found`.","inputSchema":{"type":"object","properties":{"trade_id":{"type":"string"},"current_price":{"type":"string","description":"Decimal current market price."},"idempotency_key":{"type":"string"}},"required":["trade_id","current_price"]}},{"name":"get_dividends","description":"Per-symbol dividend history from TwelveData /dividends. Optional start_date / end_date (ISO 8601) bound the range. Returns a list of DividendEvent records (ex_date, amount, payment_date, record_date, declaration_date, currency).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string"},"start_date":{"type":"string","description":"ISO 8601 date"},"end_date":{"type":"string","description":"ISO 8601 date"},"asset_class":{"type":"string"}},"required":["symbol"]}},{"name":"get_dividends_calendar","description":"Cross-symbol upcoming-dividends calendar from TwelveData /dividends_calendar. Optional start_date / end_date (ISO 8601). Returns DividendEvent records keyed by ex_date.","inputSchema":{"type":"object","properties":{"start_date":{"type":"string"},"end_date":{"type":"string"}}}},{"name":"get_splits","description":"Per-symbol stock-split history from TwelveData /splits. Optional start_date / end_date. Returns SplitEvent records (date, from_factor, to_factor, description).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string"},"start_date":{"type":"string"},"end_date":{"type":"string"},"asset_class":{"type":"string"}},"required":["symbol"]}},{"name":"get_splits_calendar","description":"Cross-symbol upcoming stock-splits calendar from TwelveData /splits_calendar. Optional start_date / end_date.","inputSchema":{"type":"object","properties":{"start_date":{"type":"string"},"end_date":{"type":"string"}}}},{"name":"get_earnings","description":"Per-symbol earnings history from TwelveData /earnings. Optional start_date / end_date. Returns EarningsEvent records (report_date, fiscal_quarter, fiscal_year, eps_estimate, eps_actual, revenue_estimate, revenue_actual, surprise_percent).","inputSchema":{"type":"object","properties":{"symbol":{"type":"string"},"start_date":{"type":"string"},"end_date":{"type":"string"},"asset_class":{"type":"string"}},"required":["symbol"]}},{"name":"get_earnings_calendar","description":"Cross-symbol upcoming-earnings calendar from TwelveData /earnings_calendar. Optional start_date / end_date.","inputSchema":{"type":"object","properties":{"start_date":{"type":"string"},"end_date":{"type":"string"}}}},{"name":"get_ipo_calendar","description":"Upcoming and recent IPO listings from TwelveData /ipo_calendar. Optional start_date / end_date. Returns IpoEvent records (symbol, company_name, expected_date, exchange, price_low, price_high, offer_price, shares_offered).","inputSchema":{"type":"object","properties":{"start_date":{"type":"string"},"end_date":{"type":"string"}}}},{"name":"get_company_profile","description":"Issuer profile from TwelveData /profile: sector, industry, employees, address, ceo, website, description. Distinct from get_fundamentals which returns financial-statement metrics.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string"},"asset_class":{"type":"string"}},"required":["symbol"]}},{"name":"get_financial_statements","description":"Issuer financial statements from TwelveData: income statement, balance sheet, and cash flow in one response. Use this for single-stock equity research where margin trend, revenue growth, leverage, free cash flow, or balance-sheet strength matters. period may be quarterly or annual; default quarterly.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string"},"period":{"type":"string","enum":["quarterly","annual"],"description":"Statement period, default quarterly"},"asset_class":{"type":"string"}},"required":["symbol"]}},{"name":"get_company_logo","description":"Issuer logo URL from TwelveData /logo. Returns {symbol, url}.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string"},"asset_class":{"type":"string"}},"required":["symbol"]}},{"name":"get_market_state","description":"Live exchange status from TwelveData /market_state. Returns MarketStateEntry records (name, code, country, is_market_open, time_to_open, time_to_close). Optional exchange filter; default returns all 140+ venues.","inputSchema":{"type":"object","properties":{"exchange":{"type":"string"}}}},{"name":"get_market_movers_td","description":"Gainers and losers per market from TwelveData /market_movers/{market}. market: stocks | etf | mutual_funds | forex | crypto. direction: gainers | losers (default gainers). Use this for typed Twelve Data market movers when available.","inputSchema":{"type":"object","properties":{"market":{"type":"string","enum":["stocks","etf","mutual_funds","forex","crypto"]},"direction":{"type":"string","enum":["gainers","losers"]},"outputsize":{"type":"integer"}},"required":["market"]}},{"name":"get_time_series_cross","description":"Cross-currency time series from TwelveData /time_series/cross. An asset's series in an alternate quote currency. Requires base + quote + interval (e.g. 1day, 1h, 5min).","inputSchema":{"type":"object","properties":{"base":{"type":"string"},"quote":{"type":"string"},"interval":{"type":"string"},"outputsize":{"type":"integer"}},"required":["base","quote","interval"]}},{"name":"search_symbols","description":"Symbol disambiguation lookup from TwelveData /symbol_search. Pass one of query (partial name/ticker), isin, or cusip. Returns SymbolMatch records (symbol, instrument_name, exchange, mic_code, country, currency). figi sub-feature is tier-gated and returns a TierGated response if requested.","inputSchema":{"type":"object","properties":{"query":{"type":"string"},"isin":{"type":"string"},"cusip":{"type":"string"},"figi":{"type":"string"},"outputsize":{"type":"integer"}}}},{"name":"get_earliest_timestamp","description":"Oldest available data point per (symbol, interval) from TwelveData /earliest_timestamp. Useful for backfill scoping. Returns {symbol, interval, datetime, unix_time}.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string"},"interval":{"type":"string"}},"required":["symbol","interval"]}},{"name":"get_cross_listings","description":"All venues where the issuer is listed from TwelveData /cross_listings. Supports ADR-vs-underlying disambiguation and foreign-listing identification.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string"},"asset_class":{"type":"string"}},"required":["symbol"]}},{"name":"get_insider_transactions","description":"Insider transactions log from TwelveData /insider_transactions. Returns InsiderTransaction records (full_name, position, transaction_date, transaction_type, shares, price, total_value, shares_owned_after). Costs 200 TwelveData credits per call.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string"},"asset_class":{"type":"string"}},"required":["symbol"]}},{"name":"get_asset_regime","description":"Classify the market regime for one asset as risk_on, risk_off, mixed, or unclear, with a confidence score and supporting signals. Composes get_ohlcv (90d daily by default; freshness-keyed lookback) with a Sonnet-4.6 reasoning call over a curated panel of trend (regression slope, drawdown, MA stack) and volatility (realized 30d %). Returns the rich Slice-5-S4 schema consumed by the REGIME_GAUGE block renderer (regime, confidence, supporting_signals, rationale, watch, panel, _sources). Asset-class scope: equity / etf / crypto / forex / commodity.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol (e.g. BTC/USD, NVDA, EUR/USD, XAU/USD)."},"asset_class":{"type":"string","enum":["equity","etf","crypto","forex","commodity"],"description":"Asset class — drives lookback defaults and panel-derivation rules."},"freshness":{"type":"string","enum":["current","intraday","daily","historical","any"],"description":"Freshness tier from Iccha. Maps to lookback days: current/intraday → 30d, daily → 90d, historical → 365d, any → 90d. Default 'daily'."},"peer_basket":{"type":"array","items":{"type":"string"},"description":"Optional peer basket symbols for breadth comparison. v1 reduction: logged but not composed into the panel."}},"required":["symbol","asset_class"]}},{"name":"get_asset_volatility","description":"Classify the volatility regime of one asset as compressed / normal / elevated / extreme, with tier confidence, a realized-vs-implied read (when implied-vol proxy is available), and 2-3 watch levels selected from structure-derived ATR boundaries / swing highs / swing lows. Composes get_quote, get_ohlcv (365d daily), and a Sonnet-4.6 reasoning call over the structured panel. Returns the rich Slice-5-S4 schema consumed by the VOLATILITY_RADAR block renderer (tier, tier_confidence, realized_vs_implied, watch_levels, panel, _sources). When a TIME_SERIES candlestick block co-emits in the same turn, the operator-level post-processor emits an ANNOTATED_LEVELS sibling block carrying overlay anchors only (D6 — Step 1 design §3.F + §4.F). Asset-class scope: equity / etf / crypto / forex / commodity.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol (e.g. BTC/USD, NVDA, EUR/USD, XAU/USD)."},"asset_class":{"type":"string","enum":["equity","etf","crypto","forex","commodity"],"description":"Asset class — drives IV-proxy availability. EQUITY / CRYPTO have IV proxies (VIX / DVOL); ETF / FOREX / COMMODITY are realized-only."},"freshness":{"type":"string","enum":["current","intraday","daily","historical","any"],"description":"Freshness tier from Iccha. v1 always uses 365d lookback for the 1y percentile; freshness logged but does not change the fetch window."}},"required":["symbol","asset_class"]}},{"name":"get_asset_structure","description":"Identify support / resistance / POC / breakout levels for one asset, with strength grading (low / medium / high) and a brief breakout watch list. Composes get_ohlcv (180d daily) and a Sonnet-4.6 reasoning call over the structured panel of swing pivots + volume profile + recent breakouts. Returns the rich Slice-5-S4 schema consumed by the STRUCTURE_LEVELS block renderer (levels, breakout_watch, narrative, sankey_data, now_price, _sources). When a TIME_SERIES candlestick block co-emits in the same turn, the operator-level post-processor emits an ANNOTATED_LEVELS sibling block carrying overlay anchors only (D6 second consumer — Step 1 design §4.F). Sankey degeneracy: sankey_data is None when level count < 4 (frontend falls back to labeled-list view). Asset-class scope: equity / etf / crypto / forex / commodity.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol (e.g. BTC/USD, NVDA, EUR/USD, XAU/USD)."},"asset_class":{"type":"string","enum":["equity","etf","crypto","forex","commodity"],"description":"Asset class. STRUCTURE is purely OHLC-derived; all 5 streamable classes have HIGH-fidelity coverage (no IV-proxy split as VOLATILITY has)."},"freshness":{"type":"string","enum":["current","intraday","daily","historical","any"],"description":"Freshness tier from Iccha. v1 always uses 180d lookback for swing-pivot derivation + volume profile binning; freshness logged but does not change the fetch window."}},"required":["symbol","asset_class"]}},{"name":"get_asset_liquidity","description":"Classify the liquidity posture of one asset as deep / normal / thin / stressed, with a spread tier (relative to a peer basket), confidence, and peer-comparison narrative. Composes get_quote (bid/ask/spread bps), get_ohlcv (30d ADV), per-peer get_quote fan-out, and a Sonnet-4.6 reasoning call over the structured panel. Returns the rich Slice-5-S4 schema consumed by the LIQUIDITY_PANEL block renderer (posture, spread_tier, confidence, narrative, peer_callouts, depth_bar [None when degraded], comparison_lines, panel, _sources). D7 fallback: depth-bar dimension degrades to spread + volume + peer comparison for all supported asset classes. Asset-class scope: equity / etf / crypto / forex / commodity.","inputSchema":{"type":"object","properties":{"symbol":{"type":"string","description":"Instrument symbol (e.g. BTC/USD, NVDA, EUR/USD, XAU/USD)."},"asset_class":{"type":"string","enum":["equity","etf","crypto","forex","commodity"],"description":"Asset class for the liquidity read. Current path uses degraded depth for all supported classes."},"freshness":{"type":"string","enum":["current","intraday","daily","historical","any"],"description":"Freshness tier from Iccha. Drives lookback for the ADV computation. Default 'intraday'."},"peer_basket":{"type":"array","items":{"type":"string"},"description":"Peer basket symbols for spread-tier percentile derivation. Resolver-supplied default per asset class when omitted: NVDA → AMD/AVGO/INTC; BTC → ETH/SOL; XAU → XAG/WTI; EUR/USD → GBP/USD/USDJPY."}},"required":["symbol","asset_class"]}}]}