get_balance
Retrieve cryptocurrency account balances from the Bithumb exchange. Check holdings for specific coins or view all assets in your portfolio.
Instructions
Get account balance (Private)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coinCode | No | Cryptocurrency symbol (e.g. BTC, ETH) or ALL | ALL |
Implementation Reference
- src/bitThumb/index.ts:152-160 (handler)Core handler function that implements the logic for retrieving account balance by calling Bithumb's 'balance' endpoint and refining the response.public async postBalance(coinCode = 'BTC'): Promise<IPostBalance> { const params = { currency: coinCode, }; const res = <IBalanceResponse>await this.requestInfo('balance', params); const data = this.refineBalance(res, coinCode.toLowerCase()); return data; }
- src/bitThumb/index.ts:444-458 (helper)Supporting utility that refines and standardizes the raw balance response for the specific coin.private refineBalance(res: IBalanceResponse, coinCode: string) { const data: IPostBalance = { ...res, data: { total_coin: res.data[`total_${coinCode}`], total_krw: res.data.total_krw, in_use_coin: res.data[`in_use_${coinCode}`], in_use_krw: res.data.in_use_krw, available_coin: res.data[`available_${coinCode}`], available_krw: res.data.available_krw, xcoin_last_coin: res.data[`xcoin_last_${coinCode}`], }, }; return data; }
- src/index.ts:136-145 (registration)Tool registration entry in the MCP tools list, including name, description, and input schema.{ name: 'get_balance', // Renamed from postBalance for clarity, as it retrieves data description: 'Get account balance (Private)', inputSchema: { type: 'object', properties: { coinCode: { type: 'string', description: 'Cryptocurrency symbol (e.g. BTC, ETH) or ALL', default: 'ALL' } } } },
- src/index.ts:322-324 (handler)MCP CallTool request handler switch case that dispatches get_balance calls to the postBalance method.case 'get_balance': result = await this.bithumbApi.postBalance(args.coinCode as string || 'ALL'); break;
- src/index.ts:139-144 (schema)JSON schema defining the input parameters for the get_balance tool.inputSchema: { type: 'object', properties: { coinCode: { type: 'string', description: 'Cryptocurrency symbol (e.g. BTC, ETH) or ALL', default: 'ALL' } } }