Skip to main content
Glama
darved2305

groww-mcp

by darved2305

get_watchlist

Retrieve your stock watchlist with current prices and daily changes to monitor market positions on Groww.

Instructions

List all watchlist symbols with LTP and day change

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for get_watchlist that fetches the watchlist data and formats it for output.
    async () => {
      try {
        const items = await growwClient.getWatchlist();
        if (items.length === 0) return mcpText("📭 Watchlist is empty. Add symbols to track them.");
    
        const lines = items.map((w) => {
          const emoji = pnlEmoji(w.change);
          return `${emoji} ${w.symbol.padEnd(12)} ${formatCurrencyExact(w.ltp).padStart(12)}  ${pnlSign(w.change)} (${formatPercent(w.changePercent)})  ${w.name}`;
        });
    
        const text = [
          `👁️ WATCHLIST (${items.length} symbols)`,
          `${"─".repeat(70)}`,
          ...lines,
          ``,
          `As of ${nowIST()}`,
        ].join("\n");
        return mcpText(text);
      } catch (err) {
        return mcpError(normalizeError(err));
      }
    }
  • Registration of the get_watchlist tool using server.tool.
    server.tool(
      "get_watchlist",
      "List all watchlist symbols with LTP and day change",
      {},
      async () => {
        try {
          const items = await growwClient.getWatchlist();
          if (items.length === 0) return mcpText("📭 Watchlist is empty. Add symbols to track them.");
    
          const lines = items.map((w) => {
            const emoji = pnlEmoji(w.change);
            return `${emoji} ${w.symbol.padEnd(12)} ${formatCurrencyExact(w.ltp).padStart(12)}  ${pnlSign(w.change)} (${formatPercent(w.changePercent)})  ${w.name}`;
          });
    
          const text = [
            `👁️ WATCHLIST (${items.length} symbols)`,
            `${"─".repeat(70)}`,
            ...lines,
            ``,
            `As of ${nowIST()}`,
          ].join("\n");
          return mcpText(text);
        } catch (err) {
          return mcpError(normalizeError(err));
        }
      }
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/darved2305/groww-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server