fetchDeposits
Retrieve deposit history for a configured cryptocurrency account, filtering by currency code, timestamp, and limit. Supports access to over 100 exchanges via the CCXT MCP Server.
Instructions
Fetch deposit history for a configured account
Input 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') | |
| limit | No | Limit the number of deposits returned (optional) | |
| since | No | Timestamp in ms to fetch deposits since (optional) |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"accountName": {
"description": "Account name defined in the configuration file (e.g., 'bybit_main')",
"type": "string"
},
"code": {
"description": "Currency code (e.g., 'BTC', 'ETH')",
"type": "string"
},
"limit": {
"description": "Limit the number of deposits returned (optional)",
"type": "number"
},
"since": {
"description": "Timestamp in ms to fetch deposits since (optional)",
"type": "number"
}
},
"required": [
"accountName"
],
"type": "object"
}
Implementation Reference
- src/tools/account-tools.ts:134-176 (handler)The handler function that executes the fetchDeposits tool logic: checks if the exchange supports fetchDeposits, calls it with parameters, and returns the 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:115-133 (schema)Zod schema for input validation of the fetchDeposits tool parameters: accountName (required string), 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)Direct registration of the fetchDeposits tool on the MCP server using server.tool(), specifying 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)Higher-level registration call to registerAccountTools(server, ccxtServer) in CcxtMcpServer's registerTools method, which includes the fetchDeposits tool.registerAccountTools(this.server, this);