Skip to main content
Glama
gagarinyury

MCP Bitget Trading Server

by gagarinyury

getBalance

Retrieve cryptocurrency account balance information from Bitget exchange to monitor available funds for trading decisions.

Instructions

Get account balance information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetNoSpecific asset to query

Implementation Reference

  • MCP tool handler for 'getBalance': validates input using GetBalanceSchema, calls BitgetRestClient.getBalance(asset), returns JSON-formatted balance data.
    case 'getBalance': {
      const { asset } = GetBalanceSchema.parse(args);
      const balance = await this.bitgetClient.getBalance(asset);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(balance, null, 2),
          },
        ],
      } as CallToolResult;
    }
  • Zod schema definition for getBalance tool input parameters.
    export const GetBalanceSchema = z.object({
      asset: z.string().optional().describe('Specific asset to query')
    });
  • src/server.ts:150-160 (registration)
    Tool registration in listTools response: defines name, description, and input schema for getBalance.
    {
      name: 'getBalance',
      description: 'Get account balance information',
      inputSchema: {
        type: 'object',
        properties: {
          asset: { type: 'string', description: 'Specific asset to query' }
        },
        required: []
      },
    },
  • BitgetRestClient.getBalance method: fetches spot account assets via API, formats into Balance[] array, filters by asset if specified.
    async getBalance(asset?: string): Promise<Balance[]> {
      const response = await this.request<any>('GET', '/api/v2/spot/account/assets', {}, true);
      
      const balances = response.data.map((item: any) => ({
        asset: item.coin,
        free: item.available,
        locked: item.frozen,
        total: (parseFloat(item.available) + parseFloat(item.frozen)).toString()
      }));
    
      if (asset) {
        return balances.filter((balance: Balance) => balance.asset === asset);
      }
      
      return balances;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Get account balance information' implies a read-only operation, but it doesn't specify if this requires authentication, rate limits, real-time vs. cached data, or error conditions. This is a significant gap for a financial tool with no structured safety hints.

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 with no wasted words. It's front-loaded with the core purpose, making it easy to scan and understand quickly. Every word earns its place without redundancy.

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?

Given the complexity of financial tools and lack of annotations or output schema, the description is incomplete. It doesn't explain what balance information is returned (e.g., total, available, locked), how it's formatted, or any prerequisites. For a tool with no structured safety or output details, more context is needed.

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?

The input schema has 100% description coverage, with the parameter 'asset' documented as 'Specific asset to query'. The description doesn't add any meaning beyond this, such as examples of valid assets or default behavior if omitted. Since schema coverage is high, the baseline score of 3 is appropriate.

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 'Get account balance information' clearly states the verb ('Get') and resource ('account balance information'), making the tool's purpose understandable. However, it doesn't differentiate from potential siblings like 'getMarginInfo' or 'getPositions', which might also provide financial account data, so it doesn't fully distinguish scope.

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. With siblings like 'getMarginInfo' and 'getPositions' that might overlap in financial context, there's no indication of when this tool is appropriate or what specific balance information it retrieves compared to others.

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/gagarinyury/MCP-bitget-trading'

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