post_orders
Retrieve order details for a specific cryptocurrency on Bithumb exchange. Use this tool to view order history, check order status, and monitor trading activity with customizable filters for order type, timeframe, and quantity.
Instructions
Get member's order details (Private)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order_currency | Yes | Order currency symbol | |
| orderId | No | Order ID (optional) | |
| type | No | Order type (bid or ask) (optional) | |
| count | No | Number of orders to retrieve (optional, default: 100) | |
| after | No | Retrieve orders after this timestamp (optional) |
Implementation Reference
- src/index.ts:167-181 (registration)Registration of the 'post_orders' tool including its input schema in the MCP server's tools list.{ name: 'post_orders', description: 'Get member\'s order details (Private)', inputSchema: { type: 'object', properties: { order_currency: { type: 'string', description: 'Order currency symbol' }, // payment_currency removed as it's not in IPostOrdersParams orderId: { type: 'string', description: 'Order ID (optional)' }, // Corrected name type: { type: 'string', enum: ['bid', 'ask'], description: 'Order type (bid or ask) (optional)' }, count: { type: 'number', description: 'Number of orders to retrieve (optional, default: 100)' }, after: { type: 'number', description: 'Retrieve orders after this timestamp (optional)' } // Corrected type and description }, required: ['order_currency'] // Only require order_currency now }
- src/index.ts:331-351 (handler)MCP tool handler for 'post_orders': constructs IPostOrdersParams from arguments and calls bithumbApi.postOrders.case 'post_orders': // Construct params object safely using if checks const orderParams: IPostOrdersParams = { order_currency: args.order_currency as string, // payment_currency removed }; if (args.orderId) orderParams.orderId = args.orderId as string; // Corrected name if (args.type) orderParams.type = args.type as tradeType; if (args.count) orderParams.count = args.count as number; // Correctly handle 'after' as a number if (args.after !== undefined && args.after !== null) { const afterNum = Number(args.after); // Convert to number if (!isNaN(afterNum)) { orderParams.after = afterNum; } else { // Handle error: 'after' argument is not a valid number throw new McpError(ErrorCode.InvalidParams, "'after' argument must be a number."); } } result = await this.bithumbApi.postOrders(orderParams); break;
- src/bitThumb/index.ts:194-200 (helper)Bithumb API helper method that performs the POST request to '/info/orders' endpoint.public async postOrders(params: IPostOrdersParams): Promise<IPostOrders> { const param = { ...params, }; const res = <IPostOrders>await this.requestInfo('orders', param); return res; }
- TypeScript interface defining the parameters for postOrders.export interface IPostOrdersParams { orderId?: string; type?: 'bid' | 'ask'; count?: number; after?: number; order_currency: string; }