Skip to main content
Glama
kukapay

hyperliquid-info-mcp

get_user_fees

Fetch fee structure and rates for a specific Hyperliquid user account, including maker and taker fees.

Instructions

Fetch the fee structure and rates for 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 the user's fee structure, including maker and taker fees.
        Returns a JSON string with an error message if the query fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_addressYes

Implementation Reference

  • main.py:217-235 (handler)
    The main handler function for the 'get_user_fees' tool. It is registered using the @mcp.tool() decorator. The function queries the Hyperliquid SDK's info.user_fees method and returns the result as JSON, with error handling.
    @mcp.tool()
    async def get_user_fees(account_address: str, ctx: Context) -> str:
        """
        Fetch the fee structure and rates for 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 the user's fee structure, including maker and taker fees.
                Returns a JSON string with an error message if the query fails.
        """
        try:
            data = info.user_fees(account_address)
            return json.dumps(data)
        except Exception as e:
            return json.dumps({"error": f"Failed to fetch user fees: {str(e)}"})
  • main.py:218-218 (registration)
    The @mcp.tool() decorator registers the get_user_fees function as an MCP tool.
    async def get_user_fees(account_address: str, ctx: Context) -> str:
  • The docstring provides the input parameters, description, and output format, which FastMCP uses to generate the tool schema.
    """
    Fetch the fee structure and rates for 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 the user's fee structure, including maker and taker fees.
            Returns a JSON string with an error message if the query fails.
    """
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. It discloses that the tool fetches data (read-only behavior) and mentions potential failure with error messages, which is useful. However, it lacks details on authentication needs, rate limits, or what 'fails' means (e.g., network errors vs. invalid addresses). It adds some context but is incomplete for a tool with no 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.

Conciseness4/5

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

The description is well-structured with a clear purpose statement, parameter explanations, and return details. It uses bullet points for readability and avoids unnecessary words. However, the return section could be more concise (e.g., merging the two sentences), and the example address is slightly verbose, keeping it from a perfect 5.

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 1 parameter with 0% schema coverage and no output schema, the description does a good job: it explains the parameter semantics, describes the return format (JSON string with fee structure or error), and covers basic behavior. It could improve by detailing error cases or response structure more, but it's largely complete for this tool's complexity.

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?

The description adds significant meaning beyond the input schema, which has 0% coverage. It explains that 'account_address' is a Hyperliquid account address with an example format, and clarifies that 'ctx' is an MCP context object for server state access. This compensates well for the schema's lack of descriptions, though it doesn't detail all possible address formats or ctx usage.

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: 'Fetch the fee structure and rates for a specific user account.' It specifies the verb ('fetch') and resource ('fee structure and rates'), distinguishing it from siblings like get_user_state or get_user_trade_history. However, it doesn't explicitly differentiate from all siblings (e.g., get_user_funding_history also fetches user-specific data), so it's not a perfect 5.

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 fee information is needed for a user account, but provides no explicit guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, exclusions, or compare to sibling tools (e.g., get_user_state might include fee data). Usage is inferred from the purpose, but lacks clear directives.

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