Skip to main content
Glama
kukapay

hyperliquid-info-mcp

get_user_sub_accounts

Retrieve sub-accounts linked to a Hyperliquid user account by providing the account address, returning structured data for account management.

Instructions

Fetch the sub-accounts associated with a specific user account.

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

Returns:
    str: A JSON string containing a list of sub-accounts and their details.
        Returns a JSON string with an error message if the query fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_addressYes

Implementation Reference

  • main.py:319-336 (handler)
    The handler function for the 'get_user_sub_accounts' tool, decorated with @mcp.tool() for registration. It fetches sub-accounts for the given account_address using the Hyperliquid Info API and returns the data as JSON or an error message.
    @mcp.tool()
    async def get_user_sub_accounts(account_address: str, ctx: Context) -> str:
        """
        Fetch the sub-accounts associated with a specific user account.
    
        Parameters:
            account_address (str): The Hyperliquid account address (e.g., '0xcd5051944f780a621ee62e39e493c489668acf4d').
            ctx (Context): The MCP context object for accessing server state.
    
        Returns:
            str: A JSON string containing a list of sub-accounts and their details.
                Returns a JSON string with an error message if the query fails.
        """
        try:
            data = info.query_sub_accounts(account_address)
            return json.dumps(data)
        except Exception as e:
            return json.dumps({"error": f"Failed to fetch user sub accounts: {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 mentions that it 'returns a JSON string' and includes error handling, which is useful, but lacks details on permissions, rate limits, or what 'details' include. For a tool with no annotations, this leaves significant behavioral gaps.

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 front-loaded with the core purpose, followed by structured sections for parameters and returns. Every sentence adds value, with no redundant information, making it efficient and easy to parse.

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 no annotations and no output schema, the description covers the basic purpose and parameters adequately but lacks depth. It doesn't fully explain the return structure beyond 'list of sub-accounts and their details', leaving ambiguity for an AI agent to interpret the output correctly.

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?

With 0% schema description coverage, the description compensates well by explaining the 'account_address' parameter as 'The Hyperliquid account address' with an example. It also mentions the 'ctx' parameter, though not in the input schema, adding clarity beyond the minimal schema.

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 'fetch' and resource 'sub-accounts associated with a specific user account', making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like get_user_state or get_user_fees, which also fetch user-related data but for different resources.

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, such as needing a valid account address, or compare it to sibling tools like get_user_state that might provide overlapping or complementary information.

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