my_orders
Read-only
View and filter your open and recent marketplace orders by side, status, and limit to track trading activity on Theagora MCP Server.
Instructions
View your open and recent orders on the exchange.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | No | Filter by side | |
| status | No | Filter by status | |
| limit | No | Max results (default 50) |
Implementation Reference
- src/tools/exchange.ts:55-64 (handler)The my_orders tool handler that executes when the tool is called. It takes the validated input parameters (side, status, limit), passes them to client.listOrders(), and returns the JSON-formatted result.
async (params) => { const result = await client.listOrders({ side: params.side, status: params.status, limit: params.limit, }); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }], }; } - src/tools/exchange.ts:49-53 (schema)Input schema for my_orders tool using Zod validation. Defines optional filters for side (BID/ASK), status (OPEN/FILLED/CANCELLED/EXPIRED), and limit (max results).
{ side: z.enum(['BID', 'ASK']).optional().describe('Filter by side'), status: z.enum(['OPEN', 'FILLED', 'CANCELLED', 'EXPIRED']).optional().describe('Filter by status'), limit: z.number().optional().describe('Max results (default 50)'), }, - src/tools/exchange.ts:46-65 (registration)Complete registration of the my_orders tool with the MCP server. Includes tool name, description, input schema, hints (readOnlyHint, openWorldHint), and the async handler function.
server.tool( 'my_orders', 'View your open and recent orders on the exchange.', { side: z.enum(['BID', 'ASK']).optional().describe('Filter by side'), status: z.enum(['OPEN', 'FILLED', 'CANCELLED', 'EXPIRED']).optional().describe('Filter by status'), limit: z.number().optional().describe('Max results (default 50)'), }, { readOnlyHint: true, openWorldHint: true }, async (params) => { const result = await client.listOrders({ side: params.side, status: params.status, limit: params.limit, }); return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }], }; } ); - src/client.ts:255-262 (helper)API client method that implements the actual HTTP request to /orders endpoint. Accepts optional query parameters (side, status, limit, offset) and returns the orders from the Agora API.
async listOrders(params?: { side?: string; status?: string; limit?: number; offset?: number; }): Promise<any> { return this.request('/orders', { params: params as any }); }