cancel_order
Cancel an active trading order by its unique ID to manage positions and control investment execution.
Instructions
Cancel an active 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": {
"orderId": "<orderId>"
},
"name": "cancel_order"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderId | Yes | The unique identifier of the order to cancel |
Implementation Reference
- src/client.ts:161-165 (handler)The core implementation that sends the DELETE request to the server to cancel an order.
async cancelOrder(orderId: number): Promise<void> { await this.request(`/equity/orders/${orderId}`, { method: 'DELETE', }); } - src/index.ts:630-640 (handler)The MCP tool handler logic that validates input and calls the client implementation.
case 'cancel_order': { const { orderId } = OrderIdInputSchema.parse(args); await client.cancelOrder(orderId); return { content: [ { type: 'text', text: `Order ${orderId} cancelled successfully`, }, ], }; - src/index.ts:504-506 (schema)Input validation schema for the cancel_order tool.
const OrderIdInputSchema = z.object({ orderId: z.number(), }); - src/index.ts:139-147 (registration)MCP tool registration for cancel_order.
{ name: 'cancel_order', description: 'Cancel an active order by order ID', inputSchema: { type: 'object', properties: { orderId: { type: 'number', description: 'The unique identifier of the order to cancel',