Skip to main content
Glama
darved2305

groww-mcp

by darved2305

modify_order

Adjust price or quantity of pending limit orders on Groww to update trading strategies before execution.

Instructions

Modify price/quantity of a pending limit order

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
order_idYesOrder ID to modify
quantityNoNew quantity
priceNoNew limit price
trigger_priceNoNew trigger price

Implementation Reference

  • The handler for the modify_order tool, which validates inputs and calls the growwClient.modifyOrder method.
    // ── modify_order ──────────────────────────────────────────
    server.tool(
      "modify_order",
      "Modify price/quantity of a pending limit order",
      {
        order_id: z.string().describe("Order ID to modify"),
        quantity: z.number().int().positive().optional().describe("New quantity"),
        price: z.number().positive().optional().describe("New limit price"),
        trigger_price: z.number().positive().optional().describe("New trigger price"),
      },
      async ({ order_id, quantity, price, trigger_price }) => {
        try {
          if (!quantity && !price && !trigger_price) {
            return mcpError("At least one of quantity, price, or trigger_price must be provided");
          }
    
          const result = await growwClient.modifyOrder({
            orderId: order_id,
            quantity,
            price,
            triggerPrice: trigger_price,
          });
    
          const changes: string[] = [];
          if (quantity) changes.push(`Quantity → ${quantity}`);
          if (price) changes.push(`Price → ${formatCurrencyExact(price)}`);
          if (trigger_price) changes.push(`Trigger → ${formatCurrencyExact(trigger_price)}`);
    
          const text = [
            `✏️ ORDER MODIFIED`,
            `${"─".repeat(40)}`,
            `Order ID:  ${result.orderId}`,
            `Status:    ${result.status}`,
            `Changes:   ${changes.join(", ")}`,
            `${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