get_wallet_balance
Retrieve cryptocurrency wallet balances for Bybit trading accounts. Specify account type and optional coin to check available funds for trading operations.
Instructions
Get wallet balance
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"accountType": "<accountType>"
},
"name": "get_wallet_balance"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accountType | Yes | Account type (UNIFIED, CONTRACT, SPOT) | |
| coin | No | Coin symbol |
Implementation Reference
- src/index.ts:769-779 (handler)MCP tool handler case that invokes the BybitService.getWalletBalance method with provided arguments and formats the response as JSON text content.
case 'get_wallet_balance': { const result = await this.bybitService.getWalletBalance(typedArgs.accountType, typedArgs.coin); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } - src/index.ts:142-154 (schema)Input schema definition for the get_wallet_balance tool, specifying accountType as required and coin as optional.
inputSchema: { type: 'object', properties: { accountType: { type: 'string', description: 'Account type (UNIFIED, CONTRACT, SPOT)', }, coin: { type: 'string', description: 'Coin symbol', }, }, required: ['accountType'], - src/index.ts:139-155 (registration)Tool registration entry in the ListTools response, including name, description, and input schema.
{ name: 'get_wallet_balance', description: 'Get wallet balance', inputSchema: { type: 'object', properties: { accountType: { type: 'string', description: 'Account type (UNIFIED, CONTRACT, SPOT)', }, coin: { type: 'string', description: 'Coin symbol', }, }, required: ['accountType'], }, - src/bybit-service.ts:160-164 (helper)Core implementation of wallet balance retrieval using Bybit V5 API endpoint /v5/account/wallet-balance, constructing parameters and making authenticated GET request.
async getWalletBalance(accountType: string, coin?: string): Promise<BybitResponse<{ list: WalletBalance[] }> | { error: string }> { const params: any = { accountType }; if (coin) params.coin = coin; return this.makeBybitRequest('/v5/account/wallet-balance', 'GET', params); }