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
| Name | Required | Description | Default |
|---|---|---|---|
| order_id | Yes | Order ID to cancel |
Implementation Reference
- src/tools/orders.ts:70-92 (handler)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)); } } );