Skip to main content
Glama
t3rmed

Hyperliquid MCP Server

by t3rmed

get_open_orders

Retrieve all active trading orders for your Hyperliquid DEX wallet to monitor pending trades and manage your portfolio effectively.

Instructions

Get all open orders for the configured wallet or a specific user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userNoUser wallet address (optional, defaults to configured wallet)

Implementation Reference

  • Handler function that processes the tool call, invokes the Hyperliquid client, and formats open orders into a text response.
    async def handle_get_open_orders(client: HyperliquidClient, args: Dict[str, Any]) -> Dict[str, Any]:
        """Handle get open orders request."""
        user = args.get("user")
        result = await client.get_open_orders(user)
    
        if not result.success:
            raise ValueError(f"Failed to get open orders: {result.error}")
    
        orders = result.data or []
    
        if not orders:
            return {
                "content": [
                    TextContent(
                        type="text",
                        text="No open orders found.",
                    )
                ]
            }
    
        orders_text = "\n".join(
            f"{order['coin']} {'BUY' if order['side'] == 'B' else 'SELL'} {order['sz']} @ {order['px']} (ID: {order['oid']})"
            for order in orders
        )
    
        return {
            "content": [
                TextContent(
                    type="text",
                    text=f"Open Orders ({len(orders)}):\n\n{orders_text}",
                )
            ]
        }
  • MCP Tool object defining the name, description, and input schema for get_open_orders.
    get_open_orders_tool = Tool(
        name="get_open_orders",
        description="Get all open orders for the configured wallet or a specific user",
        inputSchema={
            "type": "object",
            "properties": {
                "user": {
                    "type": "string",
                    "description": "User wallet address (optional, defaults to configured wallet)",
                }
            },
            "required": [],
        },
    )
  • Registration of get_open_orders_tool in the MCP server's list_tools decorator method.
    @app.list_tools()
    async def list_tools() -> list:
        """List all available tools."""
        return [
            # Market data tools
            get_all_mids_tool,
            get_l2_book_tool,
            get_candle_snapshot_tool,
            # Account info tools
            get_open_orders_tool,
            get_user_fills_tool,
            get_user_fills_by_time_tool,
            get_portfolio_tool,
            # Trading tools
            place_order_tool,
            place_trigger_order_tool,
            cancel_order_tool,
            cancel_all_orders_tool,
        ]
  • Core API client method that queries the Hyperliquid API for open orders.
    async def get_open_orders(
        self, user: Optional[str] = None
    ) -> ApiResponse[List[OpenOrder]]:
        """Get all open orders."""
        try:
            payload = {
                "type": "openOrders",
                "user": user or self.config.wallet_address,
            }
    
            response = await self.client.post("/info", json=payload)
            response.raise_for_status()
            return ApiResponse(success=True, data=response.json())
        except Exception as e:
            return ApiResponse(success=False, error=str(e))
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 the tool retrieves open orders but does not disclose behavioral traits such as whether it requires authentication, rate limits, pagination, error handling, or the format of returned data. For a read operation with zero annotation coverage, this is a significant gap in transparency, though it correctly implies a non-destructive action.

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 that front-loads the core purpose ('Get all open orders') and includes key details (scope and parameter hint). There is no wasted language, making it appropriately sized and easy to parse quickly.

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 financial tool with no annotations and no output schema, the description is incomplete. It lacks details on authentication needs, rate limits, return format, error conditions, or how results are structured (e.g., list of orders with fields). For a tool interacting with wallet data, this omission reduces its usefulness for an AI agent in making informed decisions.

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?

Schema description coverage is 100%, with the single parameter 'user' documented as an optional wallet address defaulting to the configured wallet. The description adds minimal value beyond the schema by mentioning 'a specific user', but does not provide additional context like format examples or edge cases. With high schema coverage, the baseline score of 3 is appropriate as the schema handles most parameter documentation.

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 'all open orders', specifying the scope as 'for the configured wallet or a specific user'. It distinguishes the tool's purpose from siblings like 'get_user_fills' (which retrieves historical fills) and 'get_portfolio' (which retrieves overall holdings). However, it doesn't explicitly differentiate from 'cancel_all_orders' or 'place_order' in terms of action type, though the verb 'Get' implies read-only retrieval.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when needing to retrieve open orders, with a default to the configured wallet and an optional user parameter for specificity. However, it lacks explicit guidance on when to use this tool versus alternatives like 'get_user_fills' (for historical data) or 'cancel_all_orders' (for management actions). No exclusions or prerequisites are mentioned, leaving usage context somewhat inferred rather than clearly defined.

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/t3rmed/hyperliquid-mcp'

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