Skip to main content
Glama
mixuechu

Binance MCP Server

by mixuechu

place_market_order

Execute immediate cryptocurrency trades on Binance by specifying trading pair, buy/sell direction, and quantity for instant order fulfillment.

Instructions

Place a market order to buy or sell.

Args: symbol: The trading pair, e.g., BTCUSDT. side: BUY or SELL. quantity: Amount to trade.

Returns: Order placement result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes
sideYes
quantityYes

Implementation Reference

  • The handler function for the 'place_market_order' tool. It is registered via the @mcp.tool() decorator and implements placing a market order on the Binance spot market using signed API requests.
    @mcp.tool()
    def place_market_order(symbol: str, side: str, quantity: str) -> Any:
        """
        Place a market order to buy or sell.
    
        Args:
            symbol: The trading pair, e.g., BTCUSDT.
            side: BUY or SELL.
            quantity: Amount to trade.
    
        Returns:
            Order placement result.
        """
        url = "https://api.binance.com/api/v3/order"
        timestamp = int(time.time() * 1000)
        params = {
            "symbol": symbol,
            "side": side,
            "type": "MARKET",
            "quantity": quantity,
            "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.post(url, headers=headers, params=params)
        if response.status_code == 200:
            return {"message": f"{side} {quantity} {symbol} order placed"}
        return {"error": response.text}
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'place a market order' which implies a write operation with potential financial impact, but fails to disclose critical traits like authentication needs, rate limits, execution speed, or error handling. This is a significant gap for a trading tool.

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 and uses a structured format with 'Args' and 'Returns' sections, making it efficient. However, the 'Returns' section is vague ('Order placement result'), and some sentences could be more informative, slightly reducing 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 of a market order tool with no annotations, 0% schema coverage, and no output schema, the description is incomplete. It lacks details on return values, error cases, side effects (e.g., account balance changes), and how it fits with sibling tools, making it inadequate for safe and effective use.

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 lists three parameters (symbol, side, quantity) with brief examples (e.g., 'BTCUSDT', 'BUY or SELL'), adding some meaning beyond the input schema which has 0% description coverage. However, it doesn't fully compensate for the coverage gap by explaining parameter formats, constraints, or units (e.g., quantity as string vs. number), leaving ambiguity.

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 ('place') and resource ('market order') with the action ('buy or sell'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'cancel_order' or 'execute_hedge_arbitrage_strategy', which prevents 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?

No guidance is provided on when to use this tool versus alternatives like 'execute_hedge_arbitrage_strategy' for complex trades or 'cancel_order' for order management. The description lacks context about prerequisites, such as needing sufficient account balance or market conditions, leaving usage unclear.

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