fetchDeposits
Retrieve deposit history for cryptocurrency exchange accounts to track incoming funds, filter by currency and time period, and monitor account activity.
Instructions
Fetch deposit history for a configured account
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accountName | Yes | Account name defined in the configuration file (e.g., 'bybit_main') | |
| code | No | Currency code (e.g., 'BTC', 'ETH') | |
| since | No | Timestamp in ms to fetch deposits since (optional) | |
| limit | No | Limit the number of deposits returned (optional) |
Implementation Reference
- src/tools/account-tools.ts:134-176 (handler)The main execution logic for the fetchDeposits tool. Retrieves the CCXT exchange instance and calls fetchDeposits if supported, returning JSON formatted deposits or error.async ({ accountName, code, since, limit }) => { try { const exchange = ccxtServer.getExchangeInstance(accountName); // getExchangeInstance가 성공하면 인증은 보장됨 // fetchDeposits 메서드가 지원되는지 확인 if (!exchange.has["fetchDeposits"]) { return { content: [ { type: "text", text: `Account '${accountName}' (Exchange: ${exchange.id}) does not support fetching deposits`, }, ], isError: true, }; } const deposits = await exchange.fetchDeposits(code, since, limit); return { content: [ { type: "text", text: JSON.stringify(deposits, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error fetching deposits for account '${accountName}': ${ (error as Error).message }`, }, ], isError: true, }; } }
- src/tools/account-tools.ts:116-133 (schema)Zod input schema defining parameters for the fetchDeposits tool: accountName (required), code, since, limit (optional).accountName: z .string() .describe( "Account name defined in the configuration file (e.g., 'bybit_main')" ), code: z .string() .optional() .describe("Currency code (e.g., 'BTC', 'ETH')"), since: z .number() .optional() .describe("Timestamp in ms to fetch deposits since (optional)"), limit: z .number() .optional() .describe("Limit the number of deposits returned (optional)"), },
- src/tools/account-tools.ts:112-177 (registration)Registers the fetchDeposits tool on the MCP server using server.tool(), providing name, description, input schema, and handler function.server.tool( "fetchDeposits", "Fetch deposit history for a configured account", { accountName: z .string() .describe( "Account name defined in the configuration file (e.g., 'bybit_main')" ), code: z .string() .optional() .describe("Currency code (e.g., 'BTC', 'ETH')"), since: z .number() .optional() .describe("Timestamp in ms to fetch deposits since (optional)"), limit: z .number() .optional() .describe("Limit the number of deposits returned (optional)"), }, async ({ accountName, code, since, limit }) => { try { const exchange = ccxtServer.getExchangeInstance(accountName); // getExchangeInstance가 성공하면 인증은 보장됨 // fetchDeposits 메서드가 지원되는지 확인 if (!exchange.has["fetchDeposits"]) { return { content: [ { type: "text", text: `Account '${accountName}' (Exchange: ${exchange.id}) does not support fetching deposits`, }, ], isError: true, }; } const deposits = await exchange.fetchDeposits(code, since, limit); return { content: [ { type: "text", text: JSON.stringify(deposits, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error fetching deposits for account '${accountName}': ${ (error as Error).message }`, }, ], isError: true, }; } } );
- src/server.ts:374-374 (registration)Top-level call to registerAccountTools in the CcxtMcpServer constructor or method, which in turn registers the fetchDeposits tool among others.registerAccountTools(this.server, this);