Skip to content

Commit 9bbcc9e

Browse files
authored
Merge pull request #426 from coding-kitties/dev
feat: MCP server enhancements - filtering, orders & positions
2 parents 3c5910d + 011a6c5 commit 9bbcc9e

2 files changed

Lines changed: 456 additions & 83 deletions

File tree

examples/tutorial/notebooks/09_report_and_llm_workflow.ipynb

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -265,46 +265,53 @@
265265
"```\n",
266266
"\n",
267267
"Once running, your LLM in Copilot Chat (or any MCP client) automatically\n",
268-
"discovers **23 tools** it can call."
268+
"discovers **25 tools** it can call."
269269
]
270270
},
271271
{
272272
"cell_type": "markdown",
273273
"id": "11",
274274
"metadata": {},
275275
"source": [
276-
"## Step 4 — The LLM Toolkit (23 MCP Tools)\n",
276+
"## Step 4 — The LLM Toolkit (25 MCP Tools)\n",
277277
"\n",
278278
"When the MCP server starts, the LLM gets access to these tool categories:\n",
279279
"\n",
280280
"### Data Exploration\n",
281+
"| Tool | What it does | Supports `strategy_ids`? | Supports `tag`? |\n",
282+
"|------|-------------|:---:|:---:|\n",
283+
"| `list_strategies` | List all strategies with key metrics | ✅ | ✅ |\n",
284+
"| `get_strategy_details` | Deep-dive into one strategy (all metrics, parameters) | — | — |\n",
285+
"| `rank_strategies` | Rank by any metric (CAGR, Sharpe, max drawdown, etc.) | ✅ | ✅ |\n",
286+
"| `compare_strategies` | Side-by-side comparison of 2 strategies | — | — |\n",
287+
"| `get_full_analysis` | Complete data dump for AI analysis | ✅ | ✅ |\n",
288+
"| `get_trading_activity` | Trading Activity table — all 12 trading metrics | ✅ | ✅ |\n",
289+
"\n",
290+
"### Time Series (all support multi-strategy stacking + window filter)\n",
291+
"| Tool | What it does | Supports `strategy_ids`? | Supports `tag`? |\n",
292+
"|------|-------------|:---:|:---:|\n",
293+
"| `get_equity_curve` | Equity curve (portfolio value over time) | ✅ | ✅ |\n",
294+
"| `get_drawdown_series` | Drawdown over time | ✅ | ✅ |\n",
295+
"| `get_monthly_returns` | Monthly return heatmap grid | ✅ | ✅ |\n",
296+
"| `get_yearly_returns` | Yearly return summary | ✅ | ✅ |\n",
297+
"| `get_rolling_sharpe` | Rolling Sharpe ratio series | ✅ | ✅ |\n",
298+
"| `get_correlation_matrix` | Strategy correlation matrix | ✅ | ✅ |\n",
299+
"| `get_window_coverage` | Backtest window coverage info | ✅ | ✅ |\n",
300+
"| `get_portfolio_snapshots` | Portfolio initial/final value & growth | ✅ | ✅ |\n",
301+
"\n",
302+
"### Trades, Orders & Positions (single strategy)\n",
281303
"| Tool | What it does |\n",
282304
"|------|-------------|\n",
283-
"| `list_strategies` | List all strategies with key metrics |\n",
284-
"| `get_strategy_details` | Deep-dive into one strategy (all metrics, parameters) |\n",
285-
"| `rank_strategies` | Rank by any metric (CAGR, Sharpe, max drawdown, etc.) |\n",
286-
"| `compare_strategies` | Side-by-side comparison of 2+ strategies |\n",
287-
"| `get_full_analysis` | Complete data dump for AI analysis |\n",
288-
"| `get_trading_activity` | Trading Activity table — all 12 trading metrics for every strategy |\n",
289-
"\n",
290-
"### Time Series & Trades (all support multi-strategy stacking + window filter)\n",
291-
"| Tool | What it does | Multi-strategy? |\n",
292-
"|------|-------------|:---:|\n",
293-
"| `get_equity_curve` | Equity curve (portfolio value over time) | ✅ stacked table |\n",
294-
"| `get_drawdown_series` | Drawdown over time | ✅ stacked table |\n",
295-
"| `get_monthly_returns` | Monthly return heatmap grid | ✅ sequential per strategy |\n",
296-
"| `get_yearly_returns` | Yearly return summary | ✅ stacked table |\n",
297-
"| `get_rolling_sharpe` | Rolling Sharpe ratio series | ✅ stacked table |\n",
298-
"| `get_trades` | All trades with entry/exit prices, P&L | single |\n",
299-
"| `get_symbol_breakdown` | Per-symbol performance breakdown | single |\n",
300-
"| `get_return_scenarios` | Best/worst case return scenarios | single |\n",
301-
"| `get_correlation_matrix` | Strategy correlation matrix | all strategies |\n",
302-
"| `get_window_coverage` | Backtest window coverage info | all strategies |\n",
303-
"| `get_portfolio_snapshots` | Portfolio initial/final value & growth | ✅ stacked table |\n",
305+
"| `get_trades` | All trades with entry/exit prices, P&L (top N by return magnitude) |\n",
306+
"| `get_orders` | All orders with side, type, status, price, amount, filled, cost, fee, fee_rate, slippage. Supports `window` filter and `limit` (default 50) |\n",
307+
"| `get_positions` | All positions with symbol, amount, cost. Supports `window` filter |\n",
308+
"| `get_symbol_breakdown` | Per-symbol performance breakdown |\n",
309+
"| `get_return_scenarios` | Best/worst case return scenarios |\n",
304310
"\n",
305311
"**Multi-strategy usage:** Pass `strategy_ids: [\"strat_A\", \"strat_B\", \"strat_C\"]`\n",
306-
"instead of `strategy_id` to get a stacked comparison. Add `window: \"2024\"` to\n",
307-
"filter to a specific backtest window.\n",
312+
"instead of `strategy_id` to get a stacked comparison. Add `window: \"2024\"`\n",
313+
"to filter to a specific backtest window. Or use `tag: \"experiment_A\"`\n",
314+
"to filter by batch tag.\n",
308315
"\n",
309316
"### Notes & Report Building\n",
310317
"| Tool | What it does |\n",
@@ -314,7 +321,7 @@
314321
"| `get_note` | Read a note (shows snapshot IDs for embedding) |\n",
315322
"| `update_note` | Update note content, selections, or embed snapshots |\n",
316323
"| `delete_note` | Remove a note |\n",
317-
"| `filter_strategies` | Apply a note's keep/maybe/reject selections to the dashboard |"
324+
"| `filter_strategies` | Filter strategies by metric conditions (supports `strategy_ids` + `tag` pre-filtering) |"
318325
]
319326
},
320327
{

0 commit comments

Comments
 (0)