Skip to content

Use case · Indices

Which MCP server can compare Indian indices, or a stock against its index?

Disclosure: DalalOS publishes this page and runs the MCP server it describes. We called every tool on it against the live server on 29 November 2026, and the example output below comes from those calls.

DalalOS has two tools for this: compare_indices for 2 to 10 NSE indices over one window, and get_stock_vs_index for one stock next to an index. Both work from NSE's daily closes.

Free to start, no card needed. Sign in once from your AI — no API key to manage.

KEY TAKEAWAYS

  • What DalalOS is for: comparing NSE indices, or a stock against its index, in an AI assistant. Both tools compute return, volatility and drawdown over the same window from NSE daily closes and say that returns exclude dividends.
  • compare_indices returns price return, annualised volatility, maximum drawdown and the largest one-day gain and fall for each index you name.
  • get_stock_vs_index returns the same measures for a stock and an index, plus difference_pct, the stock's return minus the index's in percentage points.
  • The default window is 365 days and the longest is 1825. Returns are price returns, with no dividends.

What does compare_indices return?

compare_indices takes index names such as Nifty 50 and Nifty Bank, 2 to 10 of them, and one window. For each index it returns:

  • Price return. Last close over first close in the window, as a percentage.
  • Annualised volatility. The standard deviation of daily returns times the square root of 252.
  • Maximum drawdown. The largest fall from a running peak, as a percentage.
  • Largest one-day gain and fall. Each with its date.
  • Trading days used. The number of closes in the window.

The window is days back from the newest stored day (default 365, up to 1825), or a from and to date. If an index name is not found, or it has too few days, the response lists it as missing and shows the valid names. To read one index's open, high, low, close and P/E, use get_index_valuation.

What does get_stock_vs_index return?

get_stock_vs_index takes an NSE equity symbol and an index name (Nifty 50 if you give none), and the same kind of window. It returns the measures above for the stock and for the index, and difference_pct.

How a split or bonus is handled

The stock's return compounds NSE's own close divided by previous close, day by day. A split or bonus issue does not appear as a fall, which a plain first-to-last comparison of unadjusted prices would show. The index side is close to close. The two spans can differ by a day at an edge, and the response carries a method note.

What does a real answer look like?

On 29 November 2026 we called both tools on the live server with a 365-day window, which ended on the newest stored day, 27 November 2026. compare_indices was given Nifty 50 and Nifty Midcap 150. get_stock_vs_index was given Infosys (INFY) against Nifty IT; its difference_pct is the stock's return minus the index's, in percentage points. Both are price returns without dividends.

compare_indices · Nifty 50, Nifty Midcap 150 · days 365 · 29 Nov 2026
{
  "from": "2025-11-27",
  "to": "2026-11-27",
  "annualisation": "sqrt(252)",
  "results": [
    { "index": "Nifty 50", "start_level": 26215.55, "end_level": 25607.2, "return_pct": -2.32,
      "annualised_volatility_pct": 14.64, "max_drawdown_pct": -15.56, "trading_days": 247 },
    { "index": "Nifty Midcap 150", "start_level": 22420.1, "end_level": 22652.7, "return_pct": 1.04,
      "annualised_volatility_pct": 16.89, "max_drawdown_pct": -14.05, "trading_days": 247 }
  ],
  "reading_notes": ["Returns are price returns and do not include dividends."]
}

Trimmed from the live response: best_day and worst_day left out. No value changed.

get_stock_vs_index · INFY vs Nifty IT · days 365 · 29 Nov 2026
{
  "symbol": "INFY",
  "index": "Nifty IT",
  "from": "2025-11-27",
  "to": "2026-11-27",
  "stock": { "return_pct": -27.1, "annualised_volatility_pct": 32.28, "max_drawdown_pct": -42.17 },
  "index_stats": { "return_pct": -12.52, "annualised_volatility_pct": 26.8, "max_drawdown_pct": -34.74 },
  "difference_pct": -14.58,
  "days_without_row": 0,
  "series_used": ["EQ"]
}

Trimmed from the live response: per-side dates, best and worst days, trading_days and the method note left out. No value changed.

Which tool answers which question?

Index and stock comparison tools
QuestionToolNotes
How did several indices compare over one window?compare_indices2 to 10 indices, up to 1825 days
How did one stock compare with an index?get_stock_vs_indexNSE equity symbol, default index Nifty 50
What are an index's P/E, P/B and dividend yield over time?get_index_valuationOne index, with valuation fields
How did each company in an index move?get_market_heatmapConstituents, with returns over several horizons
How did one stock's price move, adjusted for splits?get_price_historyDaily, weekly or monthly bars

How do I ask for it?

EXAMPLE PROMPTS

  • Compare Nifty 50, Nifty Midcap 100 and Nifty Smallcap 100 over the last two years. Show return, volatility and maximum drawdown.
  • Which of Nifty IT, Nifty Bank and Nifty Pharma had the largest fall from a peak over the last 365 days?
  • Compare Infosys with Nifty IT over the last 365 days. Show the difference in percentage points.
  • Show the largest one-day gain and the largest one-day fall for Nifty 50 over the last year, with dates.

The code is on GitHub: DalalOS-Indian-Stock-Research on GitHub. To set it up, connect your AI, or follow the guide for Claude, ChatGPT or Cursor and other AI tools. The server is at https://mcp.dalalos.in/mcp. For a company against its peers instead of an index, see comparing a stock with its peers.

How we checked

We wrote this page on 3 November 2026 from the compare_indices and get_stock_vs_index tool definitions and their REST routes. The parameters, limits, formulas and method note come from those definitions. On 29 November 2026 we called both tools once on the live server, and the examples above are trimmed from those responses. This is research data, not investment advice. Found an error? Email hello@dalalos.in.

FAQ

Common questions

Which MCP server can compare Indian indices, or a stock against its index?
DalalOS runs one. Its compare_indices tool takes 2 to 10 NSE index names and returns each one's price return, annualised volatility, maximum drawdown and largest one-day gain and fall over the same window. Its get_stock_vs_index tool does the same for one stock next to an index, and adds the difference in percentage points. DalalOS publishes this page. We called its tools on the live server on 29 November 2026, and the examples below are from those calls.
How is volatility calculated?
It is the standard deviation of the index's daily returns, multiplied by the square root of 252 to annualise it. The response states the annualisation it used.
How is maximum drawdown calculated?
It is the largest fall from a running peak to a later low in the window, as a percentage of that peak. It uses NSE's own daily closes.
How long can the window be?
The default is 365 days back from the newest stored day. You can ask for up to 1825 days, or give a from and to date. The tool uses the dates NSE has in the window, so a short window or a missing index can return fewer days than you asked for.
What if I spell an index name differently?
Names are not case-sensitive. If a name is not found, the response says which names did not match and lists the valid index names.
How do splits and bonus issues affect the stock's return?
They do not break it. The stock side of get_stock_vs_index compounds NSE's own close divided by previous close for each day, so a split or bonus day does not show up as a fall. The index side uses close to close. The two spans can differ by a day at an edge, and the response includes a method note saying so.
Do the returns include dividends?
No. These are price returns only, for both the stock and the index.
Is this investment advice?
No. The tools do arithmetic on published closes. DalalOS does not say whether a stock or an index is a good choice, and it gives no ratings or target prices. Past returns do not predict future ones. Nothing on this page is investment advice.

Connect your AI to Indian stock market data

Add DalalOS as a connector and sign in once. Free to start with no card and no waitlist; paid plans from ₹199 a month when you need more.

KEEP EXPLORING