tradeblocks-mcp
MCP server for options trade analysis
Versions
3.8.0latest3.7.03.6.13.6.03.5.0+ show 57 moreshow less
3.4.03.3.13.0.33.0.23.0.13.0.03.0.0-beta.53.0.0-beta.43.0.0-beta.33.0.0-beta.23.0.0-beta.12.3.02.2.62.2.52.2.42.2.32.2.22.2.12.2.02.2.0-beta.82.2.0-beta.72.2.0-beta.62.2.0-beta.52.2.0-beta.42.2.0-beta.32.2.0-beta.22.2.0-beta.12.1.02.1.0-beta.22.1.0-beta.12.0.12.0.02.0.0-beta.22.0.0-beta.11.3.01.3.0-beta.31.3.0-beta.21.3.0-beta.11.2.11.2.01.1.01.0.11.0.00.4.80.4.20.4.10.4.00.3.00.2.40.2.30.2.20.2.10.2.00.1.30.1.20.1.10.1.0Tools 70
get_option_snapshot Fetch live option chain snapshot with greeks, IV, open interest, and quotes from Massive.com.
profile_strategy Create or update a strategy profile for a block. Stores structure type, greeks bias,
get_strategy_profile Retrieve a single strategy profile by block_id and strategy_name.
list_profiles List strategy profiles. Provide block_id to filter by block, or omit to list all profiles
delete_profile Delete a strategy profile by block_id and strategy_name.
run_sql Execute a SQL query against the DuckDB analytics database.
regime_allocation_advisor Cross-reference strategy profiles' expected regimes with actual trading performance.
register_underlying Add or update an underlying→roots mapping in the ticker registry.
unregister_underlying Remove a user or user-override ticker entry. Bundled defaults cannot be removed;
list_underlyings List all ticker registry entries (bundled defaults + user-added + user-overrides).
resolve_root Debug helper: show how a symbol resolves through the ticker registry.
get_greeks_attribution Decompose a block's P&L into Greek components (delta, gamma, theta, vega).
portfolio_structure_map Build a Vol_Regime x Trend_Direction matrix (18 cells) across all profiled strategies.
analyze_structure_fit Analyze how well a strategy fits various market dimensions using its stored profile.
validate_entry_filters Validate effectiveness of a strategy's entry filters. Splits trades into entered vs
describe_database Get complete database schema: all tables, columns, types, row counts, and example queries.
purge_market_table Delete all data from a market table and clear its sync metadata.
fetch_bars Fetch OHLCV bars for one or more tickers over a date range.
fetch_quotes Fetch minute-level option quotes. Two modes — pass EITHER 'tickers' (specific OCC contracts, per-ticker provider calls) OR 'underlyings' (every contract under a symbol, provider bulk-by-root path — ThetaData only).
fetch_chain Fetch the historical option contract list for one or more underlyings over a date range.
import_flat_file Provider-agnostic flat-file ingest. Reads rows from a local file (parquet, csv, jsonl, .gz — anything DuckDB can read via read_parquet/read_csv/read_json) and writes them to a target market store for a single partition.\n\n
compute_vix_context Compute cross-ticker VIX context enrichment (Vol_Regime, Term_Structure_State, VIX ratios, etc.) for a date range.
refresh_market_data Composite daily-refresh driver. Calls fetch_bars \u2192 fetch_chain \u2192 fetch_quotes \u2192 compute_vix_context for a caller-supplied universe, then returns coverage report.
analyze_period_metrics Segment a block's trades by year, quarter, and month with per-period statistics, trend detection via linear regression, and worst consecutive losing month identification. Foundation for edge decay analysis.
analyze_rolling_metrics Compute rolling window statistics, quarterly seasonal averages, and recent-vs-historical comparison with structural flags for a block's trades. Foundation for edge decay analysis.
analyze_regime_comparison Run dual Monte Carlo simulations comparing full trade history vs recent window to detect regime divergence. Compares P(Profit), expected return, Sharpe ratio, and median max drawdown between the two periods. Returns a composite divergence score (0 = aligned, higher = more divergent).
analyze_walk_forward_degradation Run progressive walk-forward analysis to track whether out-of-sample performance is degrading relative to in-sample. Slides IS/OOS windows across trade history, computes efficiency ratios (OOS metric / IS metric) for Sharpe, win rate, and profit factor, detects trends via linear regression, and compares recent vs historical OOS efficiency.
analyze_live_alignment Compare backtest trades against actual (reporting log) trades to assess live execution alignment. Computes direction agreement rate (% of days where both agree on win/loss), per-strategy execution efficiency (actual P/L as ratio of backtest P/L), and alignment trend over time via monthly regression. Returns graceful skip when no reporting log exists.
analyze_edge_decay Run comprehensive edge decay analysis combining all 5 signal categories:
analyze_exit_triggers Analyze when exit triggers would fire on a trade replay. Runs replay internally
decompose_greeks Decompose a trade's P&L into greek factor contributions (delta, gamma, theta,
import_market_csv Import minute bars from a CSV file into the spot dataset via SpotStore.writeBars.
import_from_database Import minute bars from an external DuckDB database into the spot dataset via
replay_trade Replay a trade using historical minute-level option bars.
import_csv Import a CSV file from the local filesystem into the blocks directory.
analyze_regime_performance Break down a block's trade performance by market regime using market.enriched + market.spot_daily (including VIX tickers) and market.enriched_context.
suggest_filters Analyze a block's losing trades and suggest market-based filters that would have improved performance.
enrich_trades Enrich trades with market context from market.enriched + market.spot_daily (ticker-specific + VIX tickers) and market.enriched_context using correct temporal joins.
calculate_orb Calculate Opening Range Breakout (ORB) levels from market.spot bar data.
get_backtest_help Get Option Omega backtesting guidance. Covers strategy setup, strike selection,
enrich_market_data Compute technical indicator fields from raw OHLCV data in market.spot_daily and write derived fields to market.enriched + market.enriched_context.
get_performance_charts Get chart data for performance visualizations: equity curves, drawdowns, return distributions, rolling metrics, and trade patterns. Use blockId from list_blocks.
get_period_returns Get P&L breakdown by period (monthly, weekly, or daily) with reported P/L, commissions, and basis-aware net P/L. Option Omega reported P/L already includes fees.
compare_backtest_to_actual Compare backtest (tradelog.csv) results to actual reported trades (reportinglog.csv) with scaling options for fair comparison. Matches trades by date and strategy. When no dateRange is specified, comparison is auto-limited to the reporting log's date range overlap. By default, output includes matched and unmatched comparisons; set matchedOnly=true to include only matched rows. Supports trade-level detail, outlier detection, and flexible grouping. Limitation: Trade-level matching uses minute precision; if multiple trades share the same date+strategy+minute, matching is order-dependent.
batch_exit_analysis Analyze how a candidate exit policy would perform across multiple trades in a block.
run_walk_forward Execute walk-forward analysis to test parameter robustness across time windows
run_monte_carlo Run Monte Carlo simulation to project future performance and calculate risk metrics
get_correlation_matrix Calculate correlation matrix between strategies to identify diversification
get_tail_risk Calculate Gaussian copula tail dependence to identify extreme co-movement risk
get_position_sizing Calculate Kelly criterion position sizing for optimal capital allocation
analyze_slippage_trends Analyze slippage trends over time with statistical significance testing. Detects improvement/degradation patterns using linear regression on time-aggregated slippage data. Provides slope, R-squared, and p-value. Requires both tradelog.csv (backtest) and reportinglog.csv (actual). Limitation: Trade matching uses minute precision; if multiple trades share the same date+strategy+minute, matching is order-dependent.
analyze_discrepancies Analyze slippage patterns between backtest and actual trades. Detects systematic biases (direction, time-of-day) and correlates slippage with market conditions (VIX, gap, movement). Matches trades by date+strategy+time (minute precision). Requires both tradelog.csv (backtest) and reportinglog.csv (actual). Limitation: If multiple trades share the same date+strategy+minute, matching is order-dependent.
find_predictive_fields Identify which trade entry conditions predict profitability by calculating Pearson correlations between all numeric fields and a target field (usually P/L). Returns fields ranked by predictive strength.
filter_curve Sweep filter thresholds for a field and show performance at each threshold. Use after find_predictive_fields to determine optimal filter values. Returns outcome curves and identifies sweet spots where filtering improves performance.
suggest_strategy_matches Suggest matches between backtest and actual strategies based on P/L correlation when names don't align. Returns confidence scores (0-100), flags unmatchable strategies (systematic divergence), and lists unmatched strategies. Exact name matches auto-confirm at 100% confidence.
get_field_statistics Get detailed statistics for a specific field including min/max/avg/median/stdDev, percentiles, and histogram
strategy_similarity Detect potentially redundant strategies based on correlation, tail dependence, and trading day overlap. Flags strategy pairs that may be adding risk without diversification benefit.
what_if_scaling Explore strategy weight combinations within a portfolio. Answer 'what if I scaled strategy X to 0.5x?' questions. Shows before/after comparison with per-strategy breakdown. Profile-aware: uses backtest block data, enforces maxContractsPerTrade ceilings, flags ignoreMarginReq. Multi-strategy mode combines trades from multiple blocks.
paired_bootstrap_comparison Honest confidence intervals for 'is strategy A actually different from strategy B
portfolio_health_check Run comprehensive portfolio health assessment combining correlation, tail risk, Monte Carlo, walk-forward analysis, and profile-aware dimensions (regime coverage, day-of-week coverage, allocation concentration, correlation risk, backtest-to-live scaling). Returns unified 9-layer report: verdict -> grades -> flags -> key numbers.
list_blocks START HERE: List all available portfolio blocks. Returns blockId values needed for all other tools (get_statistics, get_block_info, get_performance_charts, etc.). Each block contains trade history, optional daily logs, and optional reporting logs (actual trade execution data).
get_block_info Get detailed metadata for a block including available strategies, date range, and daily log status. Use blockId from list_blocks.
get_reporting_log_stats Get detailed statistics about actual trade execution from reporting log. Returns per-strategy breakdown with trade counts, win rates, P&L, and contract counts. Use blockId from list_blocks. Returns null if no reporting log exists for the block.
get_statistics Get comprehensive portfolio statistics with explicit P/L and Sharpe methodology. Option Omega P/L is already net of fees. Sharpe defaults to historical FRED DTB3 rates; optionally provide a fixed annual rate. Use blockId from list_blocks. Optionally filter by strategy, ticker, or date range.
get_strategy_comparison Compare all strategies within a block with optional filtering and sorting
compare_blocks Compare performance statistics across multiple portfolios side-by-side. Use blockIds from list_blocks.
block_diff Compare two blocks with strategy overlap analysis and P/L attribution. Shows which strategies are shared vs unique between blocks, and calculates performance deltas for shared strategies.
stress_test Analyze portfolio performance during historical market stress scenarios (COVID crash, 2022 bear, VIX spikes, etc.). Shows how the portfolio performed during named periods without manually specifying date ranges.
drawdown_attribution Identify which strategies contributed most to losses during the portfolio's maximum drawdown period. Shows drawdown period (peak to trough) and per-strategy P/L attribution.
marginal_contribution Calculate how each strategy affects portfolio risk-adjusted returns (Sharpe/Sortino). Shows marginal contribution: positive means strategy IMPROVES the ratio, negative means it HURTS.
Permissions 4
network medium filesystem low shell high env_vars low