Skip to main content
Glama
ethancod1ng

Bybit MCP Server

by ethancod1ng

get_wallet_balance

Retrieve wallet balance information for Bybit trading accounts, supporting multiple account types including UNIFIED, CONTRACT, SPOT, INVESTMENT, OPTION, and FUND accounts. Specify a coin to get specific balance details or omit to view all holdings.

Instructions

Get wallet balance for a specific account type

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountTypeYes
coinNo

Implementation Reference

  • The core handler function that executes the tool logic by calling the Bybit API's getWalletBalance method.
    async getWalletBalance(accountType: string, coin?: string) {
      try {
        const response = await this.client.getWalletBalance({
          accountType: accountType as any,
          coin: coin
        });
        return response;
      } catch (error) {
        throw new Error(`Failed to get wallet balance: ${error instanceof Error ? error.message : JSON.stringify(error)}`);
      }
    }
  • MCP server dispatch handler that maps the tool name to the client method call.
    case 'get_wallet_balance':
      result = await this.client.getWalletBalance(
        args.accountType as string,
        args.coin as string
      );
      break;
  • src/tools.ts:60-68 (registration)
    Tool registration in the tools array exported for MCP server list tools request.
    {
      name: 'get_wallet_balance',
      description: 'Get wallet balance for a specific account type',
      inputSchema: {
        type: 'object',
        properties: WalletBalanceSchema.shape,
        required: ['accountType']
      }
    },
  • Zod schema defining the input parameters for the get_wallet_balance tool.
    export const WalletBalanceSchema = z.object({
      accountType: z.enum(['UNIFIED', 'CONTRACT', 'SPOT', 'INVESTMENT', 'OPTION', 'FUND']).describe('Account type'),
      coin: z.string().optional().describe('Coin name (if not provided, returns all coins)')
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states it 'gets' data (implying read-only), but doesn't mention authentication requirements, rate limits, error conditions, or what the return format looks like (e.g., numeric balance, structured object). For a financial tool with zero annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It's appropriately sized for a simple retrieval tool and front-loads the core purpose effectively.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a financial balance tool with 2 parameters, 0% schema coverage, no annotations, and no output schema, the description is inadequate. It doesn't explain what the return value contains (balance format, currency units), error handling, or prerequisites. The agent would struggle to use this correctly without additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It mentions 'account type' and implies 'coin' is optional ('if not provided, returns all coins'), adding some semantic context beyond the bare schema. However, it doesn't explain what the account types represent (e.g., UNIFIED vs SPOT) or provide examples, leaving important parameter meaning unclear.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('wallet balance') with the specific scope 'for a specific account type', making the purpose unambiguous. However, it doesn't differentiate from potential sibling tools like 'get_account_info' which might provide overlapping functionality, preventing a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_account_info' from the sibling list. It mentions 'account type' but doesn't explain why one would choose this over other account-related tools, leaving the agent with insufficient context for proper selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ethancod1ng/bybit-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server