Skip to main content
Glama
darved2305

groww-mcp

by darved2305

cancel_order

Cancel pending orders on Groww by providing the order ID to manage equity holdings and trade execution.

Instructions

Cancel a pending order by order ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
order_idYesOrder ID to cancel

Implementation Reference

  • Handler implementation and registration for the cancel_order tool.
    // ── cancel_order ──────────────────────────────────────────
    server.tool(
      "cancel_order",
      "Cancel a pending order by order ID",
      {
        order_id: z.string().describe("Order ID to cancel"),
      },
      async ({ order_id }) => {
        try {
          const result = await growwClient.cancelOrder(order_id);
          const text = [
            `❌ ORDER CANCELLED`,
            `${"─".repeat(40)}`,
            `Order ID: ${result.orderId}`,
            `Status:   ${result.status}`,
            `${result.message}`,
          ].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