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.
The one computation door. There are no typed scanners: a moving-average cross, a consecutive-session streak, a breakout, a volume spike, a candlestick pattern or a pivot-proximity screen is written here by the agent, which states the definition it applied. Four modes: SQL-filter-only (fastest), SQL over the `bars` history table (window functions for whole-market temporal scans), SQL pre-filter + Python on the pre-loaded screener / history / single-ticker DataFrames, and SQL-then-pandas: pass code with a sql_query and the query's rows arrive as the `sql_rows` DataFrame, so a facts pivot is fetched in SQL and ranked in pandas. If an exact definition matches nothing, the agent loosens one threshold itself and reports both counts on the first line. 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 SQL-only modes; with sql_query the rows arrive as `sql_rows`. |
| 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 read-only SELECT across market_screener (alias 's'), bars ('b', split-adjusted daily history for both markets), symbols, facts and metrics. Window functions and CTEs are allowed — this is how a cross, a streak or a volume spike is scanned over the whole market in one query. |
| history_needed | boolean | optional | True if the Python code needs the multi-day `history` frame. Default false. |
| days | integer | optional | History days to load when history_needed=true (1–400). Default 30. |
| universe | string | optional | An index key ('nifty_50', 'nifty_500', 'sp500' …) or a cap tier ('large-cap', 'mid-cap', 'small-cap') that bounds the screener rows. |
| ticker | string | optional | Loads single-ticker OHLCV into `df` (yfinance, 1y daily by default) — custom indicators and multi-timeframe pivot levels are computed here. |
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).
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 (a window query over bars, written by the agent)
"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.