Skip to main content
Glama
darved2305

groww-mcp

by darved2305

get_holdings

Fetch current equity holdings with average buy price, current value, and profit/loss percentage to track investment performance.

Instructions

Fetch all current equity holdings with avg buy price, current value, P&L %

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The "get_holdings" tool is registered and implemented within `registerPortfolioTools` in `src/tools/portfolio.ts`. It fetches holdings data from the `growwClient` and formats it into a text response for the MCP server.
    // ── get_holdings ──────────────────────────────────────────
    server.tool(
      "get_holdings",
      "Fetch all current equity holdings with avg buy price, current value, P&L %",
      {},
      async () => {
        try {
          const holdings = await growwClient.getHoldings();
          if (holdings.length === 0) return mcpText("📭 No holdings found. Your portfolio is empty.");
    
          const lines = holdings.map((h) => {
            const emoji = pnlEmoji(h.pnl);
            return [
              `${emoji} ${h.symbol}.${h.exchange} — ${h.name}`,
              `   Qty: ${h.quantity}  |  Avg: ${formatCurrencyExact(h.avgBuyPrice)}  |  LTP: ${formatCurrencyExact(h.currentPrice)}`,
              `   Invested: ${formatCurrency(h.investedValue)}  |  Current: ${formatCurrency(h.currentValue)}`,
              `   P&L: ${pnlSign(h.pnl)} (${formatPercent(h.pnlPercent)})  |  Day: ${pnlSign(h.dayChange)} (${formatPercent(h.dayChangePercent)})`,
            ].join("\n");
          });
    
          const header = `📊 YOUR HOLDINGS (${holdings.length} stocks)\n${"─".repeat(50)}`;
          const footer = `\nAs of ${nowIST()}`;
          return mcpText([header, ...lines, footer].join("\n\n"));
        } catch (err) {
          return mcpError(normalizeError(err));
        }
      }
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'fetch all current equity holdings' but doesn't disclose behavioral traits like whether this requires authentication, rate limits, real-time vs. cached data, pagination, or error conditions. The description is minimal and lacks operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('Fetch all current equity holdings') and specifies key data fields. There is zero waste, and every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and 0 parameters, the description is minimally complete for a read-only tool. It states what data is fetched but lacks context on format, scope (e.g., all accounts or filtered), or behavioral expectations, leaving gaps for an agent to infer.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description adds no parameter semantics, but with zero parameters, the baseline is 4 as it adequately addresses the tool's purpose without unnecessary detail.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Fetch') and the resource ('all current equity holdings') with specific data fields (avg buy price, current value, P&L %). It distinguishes from siblings like get_portfolio_summary (likely aggregated) or get_positions (may include non-equities), though not explicitly named.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving detailed equity holdings data, but provides no explicit guidance on when to use this tool versus alternatives like get_portfolio_summary or get_positions. Context is clear but lacks exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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