get_order_history
Retrieve past trading orders with pagination and filtering options to analyze transaction history and track investment performance.
Instructions
Get historical orders with pagination support
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_order_history"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cursor | No | Pagination cursor for fetching next page | |
| limit | No | Maximum number of results to return (default 50) | |
| ticker | No | Filter by ticker symbol |
Implementation Reference
- src/index.ts:799-809 (handler)Tool handler in the main MCP switch block.
case 'get_order_history': { const { cursor, limit, ticker } = PaginatedWithTickerInputSchema.parse(args); const history = await client.getOrderHistory({ cursor, limit, ticker }); return { content: [ { type: 'text', text: JSON.stringify(history, null, 2), }, ], }; - src/client.ts:258-275 (helper)Actual API client implementation for fetching order history.
async getOrderHistory(params?: { cursor?: number; limit?: number; ticker?: string; }): Promise<{ items: HistoricalOrder[]; nextPagePath?: string }> { const queryParams = new URLSearchParams(); if (params?.cursor) queryParams.append('cursor', params.cursor.toString()); if (params?.limit) queryParams.append('limit', params.limit.toString()); if (params?.ticker) queryParams.append('ticker', params.ticker); const endpoint = `/equity/history/orders${queryParams.toString() ? `?${queryParams.toString()}` : ''}`; const response = await this.request<{ items: unknown[]; nextPagePath?: string }>(endpoint); return { items: z.array(HistoricalOrderSchema).parse(response.items), nextPagePath: response.nextPagePath, }; }