get_order_status
Check real-time status of a specific order by providing the order ID to track execution and completion details.
Instructions
Real-time status of a specific order
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order_id | Yes | Order ID to check |
Implementation Reference
- src/tools/orders.ts:137-172 (handler)The handler for the "get_order_status" tool, which uses `growwClient` to fetch order details and formats the output.
// ── get_order_status ────────────────────────────────────── server.tool( "get_order_status", "Real-time status of a specific order", { order_id: z.string().describe("Order ID to check"), }, async ({ order_id }) => { try { const o = await growwClient.getOrderStatus(order_id); const statusEmoji: Record<string, string> = { EXECUTED: "✅", PENDING: "⏳", CANCELLED: "❌", REJECTED: "🚫", PARTIAL: "🔶", }; const emoji = statusEmoji[o.status] || "❓"; const text = [ `${emoji} ORDER STATUS`, `${"─".repeat(40)}`, `Order ID: ${o.orderId}`, `Symbol: ${o.symbol}.${o.exchange}`, `Action: ${o.orderType} / ${o.priceType} / ${o.productType}`, `Quantity: ${o.quantity}${o.filledQuantity > 0 ? ` (filled: ${o.filledQuantity})` : ""}`, o.price > 0 ? `Price: ${formatCurrencyExact(o.price)}` : `Price: MARKET`, o.avgFilledPrice > 0 ? `Avg Fill: ${formatCurrencyExact(o.avgFilledPrice)}` : "", `Status: ${o.status}`, o.remarks ? `Remarks: ${o.remarks}` : "", ``, `As of ${nowIST()}`, ].filter(Boolean).join("\n"); return mcpText(text); } catch (err) { return mcpError(normalizeError(err)); } } );