Skip to main content
Glama
kukapay

hyperliquid-info-mcp

get_user_order_by_oid

Retrieve specific order details using order ID for a Hyperliquid account. Returns order information including symbol, size, price, and status.

Instructions

Fetch details of a specific order by its order ID for a user account.

Parameters:
    account_address (str): The Hyperliquid account address (e.g., '0xcd5051944f780a621ee62e39e493c489668acf4d').
    oid (int): The order ID to query.
    ctx (Context): The MCP context object for accessing server state.

Returns:
    str: A JSON string containing the order details, including symbol, size, price, and status.
        Returns a JSON string with an error message if the query fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_addressYes
oidYes

Implementation Reference

  • main.py:277-277 (registration)
    Registration of the get_user_order_by_oid tool using the @mcp.tool() decorator.
    @mcp.tool()
  • main.py:278-295 (handler)
    The handler function implements the tool logic by calling Hyperliquid's info.query_order_by_oid API and returning the JSON response, with error handling.
    async def get_user_order_by_oid(account_address: str, oid: int, ctx: Context) -> str:
        """
        Fetch details of a specific order by its order ID for a user account.
    
        Parameters:
            account_address (str): The Hyperliquid account address (e.g., '0xcd5051944f780a621ee62e39e493c489668acf4d').
            oid (int): The order ID to query.
            ctx (Context): The MCP context object for accessing server state.
    
        Returns:
            str: A JSON string containing the order details, including symbol, size, price, and status.
                Returns a JSON string with an error message if the query fails.
        """
        try:
            data = info.query_order_by_oid(account_address, oid)
            return json.dumps(data)
        except Exception as e:
            return json.dumps({"error": f"Failed to fetch user order by oid: {str(e)}"})
Behavior3/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 describes the return format (JSON string with order details or error message) and implies a read-only operation ('Fetch', 'query'), but doesn't mention potential rate limits, authentication requirements, error conditions beyond failure, or whether the query is real-time/historical. It adds some context but leaves gaps for a 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.

Conciseness5/5

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

The description is efficiently structured with a clear purpose statement followed by parameter and return sections. Every sentence adds value: the first defines the tool's function, the parameter explanations provide necessary details, and the return statement clarifies output format. No wasted words or redundant information.

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

Completeness4/5

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

Given 2 parameters with 0% schema coverage and no annotations or output schema, the description does well by documenting all parameters and return format. However, as a data retrieval tool with no behavioral annotations, it could benefit from mentioning authentication needs, rate limits, or query limitations. It's mostly complete but has minor gaps in operational context.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must fully compensate. It explicitly lists and explains all 2 parameters: account_address ('The Hyperliquid account address') with an example, and oid ('The order ID to query'). The description adds essential meaning beyond the bare schema, fully documenting parameter purposes and formats.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Fetch details') and resource ('a specific order by its order ID for a user account'), distinguishing it from sibling tools like get_user_open_orders (which lists multiple orders) and get_user_order_by_cloid (which uses a different identifier). The verb+resource combination is precise and unambiguous.

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

Usage Guidelines4/5

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

The description implies usage context by specifying 'for a user account' and naming the required parameters (account_address and oid), but it doesn't explicitly state when to use this tool versus alternatives like get_user_order_by_cloid or get_user_open_orders. The guidance is clear for the intended scenario but lacks explicit sibling differentiation.

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

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