add_to_watchlist
Add stock symbols to your watchlist for tracking market data and managing equity holdings on the Groww platform.
Instructions
Add a stock symbol to your watchlist
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | Stock symbol to add, e.g. RELIANCE | |
| exchange | No | Exchange | NSE |
Implementation Reference
- src/tools/watchlist.ts:45-61 (handler)The `add_to_watchlist` tool definition, input schema, and handler logic.
server.tool( "add_to_watchlist", "Add a stock symbol to your watchlist", { symbol: z.string().describe("Stock symbol to add, e.g. RELIANCE"), exchange: z.enum(["NSE", "BSE"]).default("NSE").describe("Exchange"), }, async ({ symbol, exchange }) => { try { const sym = normalizeSymbol(symbol); const result = await growwClient.addToWatchlist(sym, exchange); return mcpText(`✅ ${sym}.${exchange} added to watchlist`); } catch (err) { return mcpError(normalizeError(err)); } } ); - src/client.ts:157-160 (handler)The `addToWatchlist` API client method that executes the actual HTTP request.
async addToWatchlist(symbol: string, exchange: string): Promise<{ status: string; message: string }> { if (isMockMode()) return { status: "success", message: `${symbol} added to watchlist` }; return this.request("POST", "/watchlist/add", { symbol, exchange }); }