Skip to main content
Glama
mixuechu

Binance MCP Server

by mixuechu

get_open_orders

Retrieve active trading orders for a specific cryptocurrency pair on Binance to monitor positions and manage trades.

Instructions

Get open orders for a symbol.

Args: symbol: The trading pair.

Returns: List of open orders.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes

Implementation Reference

  • The handler function for the 'get_open_orders' MCP tool. It is decorated with @mcp.tool() which registers it with the FastMCP server. The function retrieves open orders for a specified trading pair (symbol) from the Binance API by signing the request and parsing the response into a list of order details (side, quantity, price).
    @mcp.tool()
    def get_open_orders(symbol: str) -> Any:
        """
        Get open orders for a symbol.
    
        Args:
            symbol: The trading pair.
    
        Returns:
            List of open orders.
        """
        url = "https://api.binance.com/api/v3/openOrders"
        timestamp = int(time.time() * 1000)
        params = {
            "symbol": symbol,
            "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:
            return [
                {
                    "side": order["side"],
                    "quantity": order["origQty"],
                    "price": order["price"]
                } for order in response.json()
            ]
        return {"error": response.text}
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 open orders but doesn't describe traits like whether it's read-only (implied by 'Get'), potential rate limits, authentication requirements, error handling, or data freshness. For a financial tool with no 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.

Conciseness4/5

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

The description is concise and well-structured, with a clear purpose statement followed by 'Args' and 'Returns' sections. Every sentence adds value, and there's no wasted text. It could be slightly improved by integrating the sections more fluidly, but overall it's efficient and front-loaded.

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 tool's complexity (financial data retrieval), lack of annotations, and no output schema, the description is incomplete. It doesn't explain return format (e.g., order details like price, quantity), error cases, or behavioral aspects like pagination or latency. For a tool with one parameter but significant contextual needs, this falls short of being fully helpful.

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 schema description coverage is 0%, so the description must compensate. It adds minimal semantics by explaining 'symbol' as 'The trading pair', which clarifies the parameter's purpose beyond the schema's title 'Symbol'. However, it doesn't provide format details (e.g., 'BTC/USD'), examples, or constraints, leaving the parameter only partially documented.

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 with 'Get open orders for a symbol', specifying both the verb ('Get') and resource ('open orders'). It distinguishes from siblings like 'get_trade_history' (historical trades) and 'place_market_order' (creating orders), though it doesn't explicitly mention these distinctions. The purpose is specific but could be more precise about what 'open orders' entails.

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), context (e.g., real-time vs. cached data), or exclusions (e.g., not for closed orders). With siblings like 'get_trade_history' for past trades, the lack of comparative usage advice leaves the agent to infer when this tool is appropriate.

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