get_quote
Retrieve real-time stock quotes including LTP, bid/ask prices, open/high/low values, and volume data for NSE or BSE symbols to support trading decisions.
Instructions
LTP, bid/ask, open, high, low, volume for a symbol (NSE/BSE)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | Stock symbol, e.g. RELIANCE, TCS, INFY | |
| exchange | No | Exchange — NSE or BSE | NSE |
Implementation Reference
- src/tools/market.ts:16-46 (handler)The handler implementation for the 'get_quote' tool. It registers the tool and executes the logic to fetch quote data using growwClient.
server.tool( "get_quote", "LTP, bid/ask, open, high, low, volume for a symbol (NSE/BSE)", { symbol: z.string().describe("Stock symbol, e.g. RELIANCE, TCS, INFY"), exchange: z.enum(["NSE", "BSE"]).default("NSE").describe("Exchange — NSE or BSE"), }, async ({ symbol, exchange }) => { try { const sym = normalizeSymbol(symbol); const q = await growwClient.getQuote(sym, exchange); const emoji = pnlEmoji(q.change); const text = [ `${q.symbol}.${q.exchange} ${emoji}`, `${q.name}`, `${"─".repeat(40)}`, `LTP: ${formatCurrencyExact(q.ltp)} (${formatPercent(q.changePercent)}, ${pnlSign(q.change)})`, `Open: ${formatCurrencyExact(q.open)} | High: ${formatCurrencyExact(q.high)} | Low: ${formatCurrencyExact(q.low)}`, `Prev Close: ${formatCurrencyExact(q.close)}`, `Bid: ${formatCurrencyExact(q.bid)} | Ask: ${formatCurrencyExact(q.ask)}`, `Volume: ${formatVolume(q.volume)} | Market Cap: ${formatCurrency(q.marketCap)}`, ``, `As of ${nowIST()}`, ].join("\n"); return mcpText(text); } catch (err) { return mcpError(normalizeError(err)); } } );