get_balance
Retrieve cryptocurrency account balances from Bithumb exchange to monitor holdings and track portfolio value.
Instructions
Get account balance (Private)
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_balance"
}
}Input 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 implementation for the get_balance tool. Fetches balance data from Bithumb's info/balance endpoint and refines the response using refineBalance helper.
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)Helper function used by postBalance to refine and format the raw balance response into the standardized IPostBalance structure.
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:137-145 (registration)Registration of the get_balance tool 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 tool call handler dispatch for get_balance, invoking the ApiBithumb postBalance method with provided coinCode or default 'ALL'.
case 'get_balance': result = await this.bithumbApi.postBalance(args.coinCode as string || 'ALL'); break;