get_top_movers
Retrieve the top 5 gaining and losing stocks for the current trading day to monitor market performance.
Instructions
Top 5 gainers and losers for the day
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/market.ts:102-134 (handler)The handler for the 'get_top_movers' MCP tool, which fetches market movers via the growwClient and formats them into a text report.
// ── get_top_movers ──────────────────────────────────────── server.tool( "get_top_movers", "Top 5 gainers and losers for the day", {}, async () => { try { const { gainers, losers } = await growwClient.getTopMovers(); const gLines = gainers.map((g, i) => ` ${i + 1}. ${g.symbol.padEnd(12)} ${formatCurrencyExact(g.ltp).padStart(12)} ${formatPercent(g.changePercent)}` ); const lLines = losers.map((l, i) => ` ${i + 1}. ${l.symbol.padEnd(12)} ${formatCurrencyExact(l.ltp).padStart(12)} ${formatPercent(l.changePercent)}` ); const text = [ `🏆 TOP MOVERS — ${new Date().toLocaleDateString("en-IN", { timeZone: "Asia/Kolkata" })}`, `${"─".repeat(50)}`, `📈 GAINERS`, ...gLines, ``, `📉 LOSERS`, ...lLines, ``, `As of ${nowIST()}`, ].join("\n"); return mcpText(text); } catch (err) { return mcpError(normalizeError(err)); } } );