GET_ORDERS
Retrieve order details from Upbit exchange using the private API. Filter orders by market, state (wait, done, cancel), and paginate results for efficient tracking.
Instructions
List Upbit orders (requires private API)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| market | No | ||
| page | No | ||
| state | No | wait |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"limit": {
"default": 100,
"maximum": 100,
"minimum": 1,
"type": "integer"
},
"market": {
"type": "string"
},
"page": {
"default": 1,
"minimum": 1,
"type": "integer"
},
"state": {
"default": "wait",
"enum": [
"wait",
"done",
"cancel"
],
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- src/tools/get-orders.ts:15-36 (handler)The getOrdersTool object defining the 'GET_ORDERS' tool, including its name, description, parameters schema reference, and the execute handler function that performs authenticated API call to fetch orders from Upbit.export const getOrdersTool = { name: "GET_ORDERS", description: "List Upbit orders (requires private API)", parameters: paramsSchema, execute: async ({ market, state, page, limit }: Params) => { ensurePrivateEnabled(); const baseURL = `${config.upbit.baseUrl}${config.upbit.apiBasePath}`; const client = createHttpClient(baseURL); const query: Record<string, string> = { state, page: String(page), limit: String(limit), }; if (market) query.market = market; const token = signJwtToken(query); const data = await fetchJson<unknown>(client, "/orders", { params: query, headers: { Authorization: `Bearer ${token}` }, }); return JSON.stringify(data, null, 2); }, } as const;
- src/tools/get-orders.ts:6-14 (schema)Zod schema (paramsSchema) and inferred TypeScript type (Params) for validating input parameters to the GET_ORDERS tool: market (optional), state, page, limit.const paramsSchema = z.object({ market: z.string().optional(), state: z.enum(["wait", "done", "cancel"]).default("wait"), page: z.number().int().min(1).default(1), limit: z.number().int().min(1).max(100).default(100), }); type Params = z.infer<typeof paramsSchema>;
- src/index.ts:36-36 (registration)Registration of the getOrdersTool with the FastMCP server instance.server.addTool(getOrdersTool);