cancel_order
Cancels an existing order by specifying the order ID, enabling management of trades through the Paper MCP Server's AI-driven trading platform. Simplifies order cancellation for streamlined trade control.
Instructions
Cancel an existing order
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orderId | Yes | Order ID to cancel |
Implementation Reference
- src/index.ts:465-467 (handler)Handler for the cancel_order tool. Makes a PUT request to the `/orders/{orderId}/cancel` endpoint using the configured axios instance to cancel the specified order.case 'cancel_order': response = await api.put(`/orders/${args.orderId}/cancel`); break;
- src/index.ts:248-257 (schema)Input schema definition for the cancel_order tool, specifying that an orderId string is required.name: 'cancel_order', description: 'Cancel an existing order', inputSchema: { type: 'object', properties: { orderId: { type: 'string', description: 'Order ID to cancel' } }, required: ['orderId'] } },
- src/index.ts:388-392 (registration)Registration of all tools, including cancel_order, via the ListToolsRequestSchema handler which returns the tools array containing the cancel_order tool definition.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });