LIST_WITHDRAWALS
Retrieve withdrawal records from your Upbit account, filtered by currency and status. Use it to track and review your withdrawal history.
Instructions
List withdrawals (requires private API)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| currency | No | ||
| state | No | ||
| page | No | ||
| limit | No |
Implementation Reference
- src/tools/list-withdrawals.ts:17-38 (handler)The handler/execute function for the LIST_WITHDRAWALS tool. Calls ensurePrivateEnabled(), builds a query with pagination params, signs a JWT token, and fetches /withdraws from Upbit API, returning JSON-stringified results.
export const listWithdrawalsTool = { name: "LIST_WITHDRAWALS", description: "List withdrawals (requires private API)", parameters: paramsSchema, execute: async ({ currency, state, page, limit }: Params) => { ensurePrivateEnabled(); const baseURL = `${config.upbit.baseUrl}${config.upbit.apiBasePath}`; const client = createHttpClient(baseURL); const query = { page, limit, currency, state, }; const token = signJwtToken(query); const data = await fetchJson<unknown>(client, "/withdraws", { params: query, headers: { Authorization: `Bearer ${token}` }, }); return JSON.stringify(data, null, 2); }, } as const; - src/tools/list-withdrawals.ts:6-13 (schema)Zod schema for the LIST_WITHDRAWALS tool parameters: optional currency, optional state, page (default 1), limit (default 50, max 100).
const paramsSchema = z .object({ currency: z.string().optional(), state: z.string().optional(), page: z.number().int().min(1).default(1), limit: z.number().int().min(1).max(100).default(50), }) .strict(); - src/index.ts:42-42 (registration)Registration of the LIST_WITHDRAWALS tool on the MCP server via server.addTool().
server.addTool(listWithdrawalsTool); - src/index.ts:21-21 (registration)Import of listWithdrawalsTool from the list-withdrawals.ts file in src/index.ts.
import { listWithdrawalsTool } from "./tools/list-withdrawals.js";