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
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"order_id": "<order_id>"
},
"name": "cancel_order"
}
}Input 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)); } } );