Documentation
The exact tools that power every answer. Every entry here is a real MCP tool registered on the production server — no roadmap fluff.
Tool Reference
All 12 tools the agent has access to. Names match the@mcp.tool(name=...)decorators on the production MCP server.
Dual-timeframe (daily + weekly) analysis: price action, EMA/SMA crossovers, RSI, MACD, Bollinger Bands, ADX, Ichimoku Cloud, support/resistance, pivot points, candlestick patterns, and a comparative daily-vs-weekly signal alignment report. Includes valuation, profitability, leverage, and quality scores (Piotroski, Altman Z).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| tickers | string[] | required | 1–3 symbols (e.g. ['AAPL'], ['TCS.NS', 'INFY.NS']). NSE → '.NS', BSE → '.BO'. |
| period | string | optional | Historical data range: '6mo', '1y', or '2y'. Default '1y'. |
Returns
Markdown report, daily + weekly chart URLs, structured analysis data per ticker for the UI card.
Screen stocks across 131 data fields using 125 filter parameters. Supports India (~2,900 NSE/BSE stocks), US (~530 S&P 500 / NASDAQ / NYSE), and Crypto. Auto-loads new tickers on demand. Returns up to 200 matches with the full row of data per stock.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| country | string | optional | 'IN' (India full SEBI universe), 'US', or 'Crypto'. |
| sector | string | optional | Exact sector name (e.g. 'Information Technology', 'Energy'). |
| industry | string | optional | Industry substring (e.g. 'Banks', 'Auto Components'). |
| filters | JSON object | optional | Filter dict using min_X/max_X keys: min_rsi, max_pe, min_roe, min_market_cap, etc. See `get_usage_guide` for the full list. |
| sort_by | string | optional | Sort field: rsi, pe, roe, market_cap, pct_change, volume, etc. |
| index | string | optional | Index name (e.g. 'nifty_50', 'sp500', 'nasdaq100'). Auto-sets country. |
| tickers | string[] | optional | Specific symbols to screen (mutually exclusive with `index`). |
Returns
Up to 200 rows with 131 fields each. Includes auto-load and staleness info. Empty results trigger a progressive breakdown showing where the filter chain dropped to zero.
Typed capability tool. Computes fast vs slow moving-average crossovers across the universe in a single DB query — no sandbox code. Picks scan_crossover over run_custom_code automatically for the 'crossed above 50-SMA in last 5 days' / 'just had a golden cross' pattern. Coverage_meta in the response reports missing or insufficient-history tickers explicitly.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| fast_period | integer | optional | Fast MA window. Default 50. |
| slow_period | integer | optional | Slow MA window. Default 200. |
| direction | string | optional | 'above' (golden cross / cross up) or 'below' (death cross). Default 'above'. |
| lookback_days | integer | optional | Crossover must have occurred within the last N trading days (1–30). Default 5. |
| ma_type | string | optional | 'sma' or 'ema'. Default 'sma'. |
| country | string | optional | 'IN' (default), 'US', or 'Crypto'. |
| universe | string | optional | 'large-cap', 'mid-cap', 'small-cap', or an index name. Limits the scan. |
| max_results | integer | optional | Cap on returned matches (1–200). Default 50. |
Returns
Matches sorted by recency: ticker, cross_date, fast_value, slow_value, close, days_ago. Plus coverage_meta (requested / scanned / missing_history / insufficient_history).
Unified sandbox for queries that don't fit a typed capability tool. Three modes: SQL-filter-only (fastest), SQL-JOIN against history, and SQL pre-filter + Python on the pre-loaded screener / history / single-ticker DataFrames. Pre-loaded names: pd, np, talib (150+ functions), yf, plus SCREENER_COLS / find_column helpers. A pre-flight AST validator auto-corrects known column-name typos (pct_change_5d → price_change_5d, Close → close, sma50 → sma_50, …) BEFORE the sandbox runs, so the agent doesn't burn a retry on a misspelled column.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| code | string (Python) | optional | Python code that assigns the result to a `results` DataFrame. Leave empty for Mode 1/2 (SQL-only). |
| query_name | string | optional | Human-readable query label (shown in tool-call card). |
| sql_filter | string | optional | SQL WHERE clause for market_screener pre-filtering (much faster than pandas). Example: "rsi_14 < 30 AND market_cap > 5e10". |
| sql_query | string | optional | Full SELECT statement for JOIN queries across market_screener (alias 's') and live_quotes_history (alias 'h'). |
| history_needed | boolean | optional | True if the code needs multi-day history. Default false. |
| days | integer | optional | History days to load when history_needed=true (1–30). Default 30. |
| ticker | string | optional | Loads single-ticker OHLCV into `df` (yfinance, 1y daily by default). |
Returns
Result DataFrame as a table, optional chart URL, plus stdout (used by the agent to learn from auto-corrected column names).
Two modes: `search` returns ranked results from DuckDuckGo; `read` extracts the article body from a URL using trafilatura (clean text, not HTML). Used by the researcher specialist for news, market commentary, URL summarization, and event-driven analysis.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | required | Search query OR URL when mode='read'. |
| mode | string | optional | 'search' (default) or 'read'. |
| max_results | integer | optional | Search-mode result cap (1–10). Default 5. |
Returns
Search mode: titles, URLs, snippets. Read mode: article text (up to ~4000 chars per page).
Runs Python code against a single ticker's OHLCV data to compute custom indicators (SuperTrend, KAMA, Keltner Channels, Fibonacci levels, etc.). Auto-renders a multi-pane chart with the indicator overlaid on price. TA-Lib (150+ functions), pandas, numpy, yfinance are pre-loaded.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ticker | string | required | Symbol (e.g. 'AAPL', 'TCS.NS', 'BTCUSD'). |
| code | string (Python) | required | Python code that adds columns to the pre-loaded `df` DataFrame. |
| indicator_name | string | required | Human-readable label (e.g. 'SuperTrend', 'Keltner Channels'). |
| period | string | optional | Historical data range: '6mo', '1y', '2y'. Default '1y'. |
| plot_type | string | optional | 'overlay' (on price chart) or 'oscillator' (separate pane). Default 'overlay'. |
Returns
Last 20 indicator values, CSV data URL, and rendered chart image.
Lists 150+ TA-Lib functions across categories: Momentum, Overlap Studies, Volatility, Volume, Cycle Indicators, Pattern Recognition. Use before writing custom indicator code to confirm whether the function already exists.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| search | string | optional | Filter indicators by substring (case-insensitive). E.g. 'rsi', 'momentum', 'cdl'. |
Returns
Matching indicator names and their TA-Lib category.
Returns official constituents for 30+ Indian indices (Nifty 50, Nifty 500, Nifty Bank, Nifty Midcap 100, etc.) and US indices (S&P 500, NASDAQ 100, Dow Jones). Indian sourced from niftyindices.com; US from canonical lists. Output is ready to pass into `market_screen`.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| index_name | string | required | Index identifier (e.g. 'nifty_50', 'nifty_bank', 'sp500'). Case-insensitive. |
Returns
JSON: index, market, count, tickers[].
Lists analysis outputs the server has cached. Without a ticker: all analyzed tickers. With a ticker: every file produced by the last analysis run (charts, reports, CSVs) with sizes. Each analysis produces ~5 files: daily + weekly chart PNGs, comparative TXT, daily TXT, weekly TXT.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ticker | string | optional | Symbol. Omit to list all analyzed tickers. |
Returns
Without ticker: ticker folder summaries. With ticker: detailed file listing with types and sizes.
Fetch a single file from a ticker's output folder. PNG charts render inline; TXT reports return as text; CSV returns a preview.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ticker | string | required | Ticker symbol (e.g. 'AAPL'). |
| filename | string | required | Exact filename or fuzzy pattern: 'daily', 'weekly_chart', 'comparative'. |
Returns
PNG as inline chart image, TXT as report text, CSV as data preview.
Lazy-loaded reference doc that specialists call to get the full screener column list, code patterns for live_market queries, candlestick CDL function catalog, yfinance fallback templates, and common error recipes. Lets us keep specialist prompts compact while still giving the model full schema access on demand.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| topic | string | required | 'presentation', 'screening', 'multi_stock', 'custom_indicator', 'screener_schema', 'live_market', or 'all'. |
Returns
Topic-specific markdown reference.
Computes all technical indicators and fundamental ratios for the given tickers and writes them to the screener cache. Usually called automatically by `market_screen` when a ticker is missing or stale.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| tickers | string[] | optional | Symbols to load. Defaults to refreshing the existing universe if omitted. |
| bg_task | boolean | optional | Run in background. Default true. |
Returns
Confirmation of load. Background tasks return immediately.
Example queries
These are routed correctly by the production planner (verified by the eval gate at 98% pass rate on the 49-query corpus).
Analyze a stock
"Analyze TCS.NS"
// Or two/three tickers side-by-side:
"Compare TCS, INFY, and HCLTECH on fundamentals and technicals"Screen for value + quality
"Indian stocks with P/E under 20 and ROE over 25%"Top N sorted by metric
"Top 10 NSE stocks by trading volume today"Sector filter
"Auto component manufacturers in India with debt/equity below 1"Temporal scan (uses scan_crossover)
"Indian large-caps that crossed above their 50-day SMA in the last 5 trading days"Custom indicator
"Run SuperTrend on INFY with ATR period 10 and multiplier 3"News + sentiment
"Any news on HCL Technologies in the past week"Sector aggregation (uses run_custom_code)
"Compute z-score of RSI within each Indian sector — show the 5 most extreme outliers"Data sources
Transparent about where every number comes from. No "real-time everything" handwaving.
Indian (NSE / BSE)
~2,900 stocks (full SEBI universe)
Groww API for live quotes (2 snapshots/day during market hours) + FMP for fundamentals + yfinance fallback for history
US (S&P 500 / NASDAQ / NYSE)
~530 stocks
FMP for fundamentals + yfinance for OHLCV + intraday quotes during market hours
Crypto
~25 major coins
yfinance / FMP for major pairs (BTC, ETH, SOL, …)
News & web
Up to 5 results/query, ~4,000 chars/article
DuckDuckGo search + trafilatura article extraction. Domain-bias toward financial sources (Moneycontrol, ET, Bloomberg, Yahoo Finance, Reuters).
Important: Indian quotes are NOT continuously live. We refresh twice per day during market hours. For an intraday tick-by-tick view, use your broker's terminal.
What we don't do (yet)
Honest gaps so nothing breaks expectations.
- •No options Greeks / F&O analytics — we cover cash-segment equities + crypto only.
- •No mutual fund / ETF holdings analysis (the screener is single-instrument).
- •No tick-by-tick streaming — Indian quotes are 2 snapshots/day.
- •Performance-vs-Nifty-50 over 60+ days currently uses yfinance fallback (the dedicated indices table ships in a follow-up).
- •The agent will say so when it hits a gap — it's built to decline rather than fabricate.