Skip to main content
Glama
mixuechu

Binance MCP Server

by mixuechu

get_account_balance

Check cryptocurrency asset balances on Binance by specifying the asset symbol to monitor account holdings and track portfolio value.

Instructions

Get the balance of a specific cryptocurrency asset.

Args: asset: The cryptocurrency symbol, e.g., BTC.

Returns: Asset balance info.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetYes

Implementation Reference

  • The handler function for the 'get_account_balance' tool. It is registered using the @mcp.tool() decorator and implements the logic to query the Binance API for the balance of a specified asset.
    @mcp.tool()
    def get_account_balance(asset: str) -> Any:
        """
        Get the balance of a specific cryptocurrency asset.
    
        Args:
            asset: The cryptocurrency symbol, e.g., BTC.
    
        Returns:
            Asset balance info.
        """
        url = "https://api.binance.com/api/v3/account"
        timestamp = int(time.time() * 1000)
        params = {"timestamp": timestamp}
        query_string = "&".join([f"{k}={v}" for k, v in params.items()])
        signature = hmac.new(BINANCE_SECRET_KEY.encode(), query_string.encode(), hashlib.sha256).hexdigest()
        params["signature"] = signature
        headers = {"X-MBX-APIKEY": BINANCE_API_KEY}
        response = requests.get(url, headers=headers, params=params)
        if response.status_code == 200:
            balances = response.json().get("balances", [])
            for balance in balances:
                if balance["asset"] == asset:
                    return {"asset": asset, "balance": balance["free"]}
            return {"error": f"No balance found for {asset}"}
        return {"error": response.text}
  • binance.py:47-47 (registration)
    The @mcp.tool() decorator registers the get_account_balance function as an MCP tool.
    @mcp.tool()
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. It states what the tool does but lacks behavioral details such as whether it requires authentication, if it's read-only (implied by 'Get' but not explicit), rate limits, error conditions, or what 'balance info' includes (e.g., available vs. total balance). This is inadequate for a financial tool with zero annotation coverage.

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

Conciseness4/5

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

The description is front-loaded with the core purpose, followed by structured Args and Returns sections. It's efficient with no wasted sentences, though the Returns section is vague ('Asset balance info') which slightly reduces clarity but not conciseness.

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 (financial/cryptocurrency context), no annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't explain return values, error handling, or behavioral traits needed for safe use in a trading environment. This leaves significant gaps for an AI agent.

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 description adds minimal semantics: it explains that 'asset' is a cryptocurrency symbol with an example (BTC). However, with 0% schema description coverage and only 1 parameter, this provides some value but doesn't fully compensate (e.g., no format constraints or valid symbols list). Baseline is 4 for 0 params, but here it's 1 param with partial info, so 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 clearly states the verb 'Get' and the resource 'balance of a specific cryptocurrency asset', which is specific and unambiguous. However, it doesn't explicitly differentiate from siblings like get_symbol_price (which might return price rather than balance), so it misses full sibling distinction.

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. For example, it doesn't specify if this is for checking available funds before trading (vs. get_open_orders) or for portfolio monitoring (vs. get_trade_history). No exclusions or prerequisites are mentioned.

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/mixuechu/binance-mcp'

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