Skip to main content
Glama
darved2305

groww-mcp

by darved2305

get_order_history

Retrieve past order details and status from your Groww account, with optional filtering by date range to track transaction history.

Instructions

Past orders with status, optionally filter by date range

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateNoStart date (YYYY-MM-DD)
end_dateNoEnd date (YYYY-MM-DD)

Implementation Reference

  • Tool registration and handler implementation for get_order_history.
    server.tool(
      "get_order_history",
      "Past orders with status, optionally filter by date range",
      {
        start_date: z.string().optional().describe("Start date (YYYY-MM-DD)"),
        end_date: z.string().optional().describe("End date (YYYY-MM-DD)"),
      },
      async ({ start_date, end_date }) => {
        try {
          const orders = await growwClient.getOrderHistory(start_date, end_date);
          if (orders.length === 0) return mcpText("📭 No orders found for the given period.");
    
          const statusEmoji: Record<string, string> = {
            EXECUTED: "✅", PENDING: "⏳", CANCELLED: "❌", REJECTED: "🚫", PARTIAL: "🔶",
          };
    
          const lines = orders.map((o) => {
            const emoji = statusEmoji[o.status] || "❓";
            return [
              `${emoji} ${o.orderId} — ${o.orderType} ${o.symbol}.${o.exchange}`,
              `   ${o.priceType} / ${o.productType}  |  Qty: ${o.quantity}  |  Price: ${o.price > 0 ? formatCurrencyExact(o.price) : "MARKET"}`,
              `   Status: ${o.status}${o.filledQuantity > 0 ? ` (filled ${o.filledQuantity} @ ${formatCurrencyExact(o.avgFilledPrice)})` : ""}`,
              `   ${new Date(o.timestamp).toLocaleString("en-IN", { timeZone: "Asia/Kolkata" })}${o.remarks ? ` — ${o.remarks}` : ""}`,
            ].join("\n");
          });
    
          const header = `📋 ORDER HISTORY (${orders.length} orders)\n${"─".repeat(50)}`;
          return mcpText([header, ...lines].join("\n\n"));
        } catch (err) {
          return mcpError(normalizeError(err));
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks behavioral details. It doesn't disclose whether this is a read-only operation, if it requires authentication, rate limits, pagination behavior, or what the return format looks like (e.g., list of orders with fields). 'Past orders with status' is minimal context.

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

Conciseness4/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 ('Past orders with status') and adds the optional filtering detail. No wasted words, though it could be slightly more structured (e.g., separating purpose from constraints).

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?

For a tool with no annotations, no output schema, and 2 parameters, the description is incomplete. It doesn't explain what 'status' includes, the order of results, pagination, error conditions, or authentication needs. Given the complexity of order history data, more context is needed for effective use.

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

Parameters3/5

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

Schema description coverage is 100%, so parameters are fully documented in the schema. The description adds marginal value by mentioning 'optionally filter by date range', which aligns with the two date parameters but doesn't provide additional semantics beyond what the schema already states.

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 retrieves 'past orders with status' and mentions optional date filtering, providing a specific verb ('get') and resource ('order history'). It distinguishes from siblings like 'get_order_status' (single order) and 'get_portfolio_summary' (aggregate data), though not explicitly.

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 historical orders, but provides no explicit guidance on when to use this versus alternatives like 'get_order_status' for specific orders or 'get_portfolio_summary' for aggregated data. No prerequisites or exclusions are mentioned.

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