Skip to main content
Glama
darved2305

groww-mcp

by darved2305

place_order

Execute BUY or SELL orders for stocks with MARKET/LIMIT pricing and CNC/MIS/NRML product types on Groww trading platform.

Instructions

Place BUY/SELL order — supports MARKET/LIMIT, CNC/MIS/NRML product types

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesStock symbol, e.g. RELIANCE
exchangeNoExchangeNSE
order_typeYesBUY or SELL
product_typeNoCNC (delivery), MIS (intraday), NRML (F&O)CNC
price_typeNoMARKET or LIMIT orderMARKET
quantityYesNumber of shares
priceNoLimit price (required for LIMIT orders)
trigger_priceNoStop-loss trigger price

Implementation Reference

  • The "place_order" tool is defined using server.tool, validating inputs with Zod, and calling the growwClient.placeOrder method.
    server.tool(
      "place_order",
      "Place BUY/SELL order — supports MARKET/LIMIT, CNC/MIS/NRML product types",
      {
        symbol: z.string().describe("Stock symbol, e.g. RELIANCE"),
        exchange: z.enum(["NSE", "BSE"]).default("NSE").describe("Exchange"),
        order_type: z.enum(["BUY", "SELL"]).describe("BUY or SELL"),
        product_type: z.enum(["CNC", "MIS", "NRML"]).default("CNC").describe("CNC (delivery), MIS (intraday), NRML (F&O)"),
        price_type: z.enum(["MARKET", "LIMIT"]).default("MARKET").describe("MARKET or LIMIT order"),
        quantity: z.number().int().positive().describe("Number of shares"),
        price: z.number().positive().optional().describe("Limit price (required for LIMIT orders)"),
        trigger_price: z.number().positive().optional().describe("Stop-loss trigger price"),
      },
      async ({ symbol, exchange, order_type, product_type, price_type, quantity, price, trigger_price }) => {
        try {
          if (price_type === "LIMIT" && !price) {
            return mcpError("Limit price is required for LIMIT orders");
          }
    
          const sym = normalizeSymbol(symbol);
          const result = await growwClient.placeOrder({
            symbol: sym,
            exchange,
            orderType: order_type,
            productType: product_type,
            priceType: price_type,
            quantity,
            price: price ?? 0,
            triggerPrice: trigger_price ?? 0,
          });
    
          const emoji = order_type === "BUY" ? "🟢" : "🔴";
          const text = [
            `${emoji} ORDER PLACED`,
            `${"─".repeat(40)}`,
            `Order ID:  ${result.orderId}`,
            `Status:    ${result.status}`,
            `Action:    ${order_type} ${sym}.${exchange}`,
            `Type:      ${price_type} / ${product_type}`,
            `Quantity:  ${quantity}`,
            price_type === "LIMIT" ? `Price:     ${formatCurrencyExact(price!)}` : `Price:     MARKET`,
            trigger_price ? `Trigger:   ${formatCurrencyExact(trigger_price)}` : "",
            ``,
            `${result.message}`,
            ``,
            `⚠️ This is ${process.env.MOCK_MODE === "true" ? "a MOCK order (no real trade)" : "a REAL order with real money"}`,
          ].filter(Boolean).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