Skip to main content
Glama
ethancod1ng

Binance MCP Server

by ethancod1ng

get_account_info

Retrieve your Binance account details and current balance information through the MCP server integration.

Instructions

获取账户信息和余额

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function executes the tool logic: validates input using GetAccountInfoSchema, fetches account information from Binance API, filters balances with non-zero free or locked amounts, computes total, and returns formatted account details including commissions, permissions, and balances.
    handler: async (binanceClient: any, args: unknown) => {
      validateInput(GetAccountInfoSchema, args);
    
      try {
        const accountInfo = await binanceClient.accountInfo();
        
        return {
          makerCommission: accountInfo.makerCommission,
          takerCommission: accountInfo.takerCommission,
          buyerCommission: accountInfo.buyerCommission,
          sellerCommission: accountInfo.sellerCommission,
          canTrade: accountInfo.canTrade,
          canWithdraw: accountInfo.canWithdraw,
          canDeposit: accountInfo.canDeposit,
          updateTime: accountInfo.updateTime,
          accountType: accountInfo.accountType,
          permissions: accountInfo.permissions,
          balances: accountInfo.balances
            .filter((balance: any) => parseFloat(balance.free) > 0 || parseFloat(balance.locked) > 0)
            .map((balance: any) => ({
              asset: balance.asset,
              free: balance.free,
              locked: balance.locked,
              total: (parseFloat(balance.free) + parseFloat(balance.locked)).toString(),
            })),
          timestamp: Date.now(),
        };
      } catch (error) {
        handleBinanceError(error);
      }
    },
  • The get_account_info tool is registered as the first entry in the exported accountTools array, which is later spread into the server's tool map.
    {
      name: 'get_account_info',
      description: '获取账户信息和余额',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
      handler: async (binanceClient: any, args: unknown) => {
        validateInput(GetAccountInfoSchema, args);
    
        try {
          const accountInfo = await binanceClient.accountInfo();
          
          return {
            makerCommission: accountInfo.makerCommission,
            takerCommission: accountInfo.takerCommission,
            buyerCommission: accountInfo.buyerCommission,
            sellerCommission: accountInfo.sellerCommission,
            canTrade: accountInfo.canTrade,
            canWithdraw: accountInfo.canWithdraw,
            canDeposit: accountInfo.canDeposit,
            updateTime: accountInfo.updateTime,
            accountType: accountInfo.accountType,
            permissions: accountInfo.permissions,
            balances: accountInfo.balances
              .filter((balance: any) => parseFloat(balance.free) > 0 || parseFloat(balance.locked) > 0)
              .map((balance: any) => ({
                asset: balance.asset,
                free: balance.free,
                locked: balance.locked,
                total: (parseFloat(balance.free) + parseFloat(balance.locked)).toString(),
              })),
            timestamp: Date.now(),
          };
        } catch (error) {
          handleBinanceError(error);
        }
      },
    },
  • Zod schema definition for GetAccountInfo input, which is an empty object since no parameters are required.
    export const GetAccountInfoSchema = z.object({});
  • Inline JSON schema provided in the tool registration for input validation, matching the empty object schema.
    inputSchema: {
      type: 'object',
      properties: {},
      required: [],
    },
  • src/server.ts:42-50 (registration)
    In the server's setupTools method, accountTools (containing get_account_info) is spread into allTools and each tool is registered in a Map by name for handling tool calls.
    const allTools = [
      ...marketDataTools,
      ...accountTools,
      ...tradingTools,
    ];
    
    for (const tool of allTools) {
      this.tools.set(tool.name, 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 of behavioral disclosure. It states the tool retrieves account information and balance, implying a read-only operation, but doesn't specify whether this requires authentication, rate limits, data freshness, or potential side effects. For a financial tool with zero annotation coverage, this is a significant gap in transparency.

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 in Chinese ('获取账户信息和余额') that directly states the tool's purpose with zero waste. It is appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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

Completeness3/5

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

Given the tool's complexity (simple read operation with no parameters) and lack of annotations/output schema, the description is minimally adequate. It states what the tool does but omits important context like authentication needs, return format, or error conditions. Without annotations or output schema, the agent lacks guidance on behavioral traits and response structure.

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

Parameters4/5

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

The tool has 0 parameters, and schema description coverage is 100% (since there are no parameters to describe). The description doesn't need to add parameter semantics, so it meets the baseline of 4 for zero-parameter tools. No additional value is required or provided.

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 tool's purpose as '获取账户信息和余额' (get account information and balance), which is a specific verb+resource combination. It distinguishes this tool from siblings like get_order_history or get_price by focusing on account data rather than market or order data. However, it doesn't explicitly differentiate from all siblings (e.g., get_open_orders also relates to account status).

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. It doesn't mention prerequisites (e.g., authentication), timing considerations, or comparisons to other tools like get_open_orders for order-related account data. The agent must infer usage from the purpose alone.

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

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