Skip to main content
Glama
darved2305

groww-mcp

by darved2305

get_positions

Retrieve current intraday open positions with unrealized profit and loss data for equity holdings on Groww.

Instructions

Intraday open positions with unrealized P&L

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'get_positions' which calls the Groww client and formats the response for the MCP server.
    // ── get_positions ─────────────────────────────────────────
    server.tool(
      "get_positions",
      "Intraday open positions with unrealized P&L",
      {},
      async () => {
        try {
          const positions = await growwClient.getPositions();
          if (positions.length === 0) return mcpText("📭 No open positions today.");
    
          const lines = positions.map((p) => {
            const emoji = pnlEmoji(p.pnl);
            return [
              `${emoji} ${p.symbol}.${p.exchange} [${p.orderType} / ${p.productType}]`,
              `   Qty: ${p.quantity}  |  Buy: ${formatCurrencyExact(p.buyPrice)}  |  LTP: ${formatCurrencyExact(p.currentPrice)}`,
              `   Unrealized P&L: ${pnlSign(p.pnl)} (${formatPercent(p.pnlPercent)})`,
            ].join("\n");
          });
    
          const header = `⚡ OPEN POSITIONS (${positions.length})\n${"─".repeat(50)}`;
          return mcpText([header, ...lines, `\nAs of ${nowIST()}`].join("\n\n"));
        } catch (err) {
          return mcpError(normalizeError(err));
        }
      }
    );
  • The client method that fetches position data from the API or mock data.
    async getPositions(): Promise<Position[]> {
      if (isMockMode()) return MOCK.positions();
      return this.request<Position[]>("GET", "/portfolio/positions");
    }
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. While it indicates this is a read operation (get), it doesn't disclose important behavioral aspects like authentication requirements, rate limits, data freshness, or whether it returns real-time or delayed data. The description provides minimal behavioral context beyond the basic operation.

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 extremely concise - a single phrase that communicates the essential purpose without any wasted words. It's front-loaded with the core functionality and appropriately sized for a simple retrieval tool.

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

Completeness2/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 the description's minimal content, this is incomplete for a financial data tool. The description doesn't explain what format the positions are returned in, what fields are included, whether it's real-time or end-of-day data, or any authentication requirements.

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?

The tool has zero parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, which is correct for this tool.

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 tool's purpose: retrieving intraday open positions with unrealized P&L. It specifies the resource (positions) and key attributes (intraday, open, with unrealized P&L), but doesn't explicitly differentiate from sibling tools like 'get_holdings' or 'get_portfolio_summary'.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, timing considerations, or how it differs from similar sibling tools like 'get_holdings' or 'get_portfolio_summary'.

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