Skip to main content
Glama
kukapay

hyperliquid-info-mcp

get_user_funding_history

Retrieve funding payment records for a Hyperliquid account within a specified time period to analyze payment history and track financial activity.

Instructions

Fetch the funding payment history for a specific user account.

Parameters:
    account_address (str): The Hyperliquid account address (e.g., '0xcd5051944f780a621ee62e39e493c489668acf4d').
    start_time (str): The start time for the funding history in ISO 8601 format (e.g., '2025-01-01T00:00:00Z').
    end_time (str): The end time for the funding history in ISO 8601 format (e.g., '2025-12-31T23:59:59Z').
    ctx (Context): The MCP context object for accessing server state.

Returns:
    str: A JSON string containing a list of funding payment records, each with details such as amount and timestamp.
        Returns a JSON string with an error message if the query fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_addressYes
start_timeYes
end_timeYes

Implementation Reference

  • main.py:148-170 (handler)
    The handler function implementing the 'get_user_funding_history' tool logic, including input parameter handling, timestamp conversion, API call to Hyperliquid SDK, JSON serialization, and error handling. Registered via @mcp.tool() decorator.
    @mcp.tool()
    async def get_user_funding_history(account_address: str, start_time: str, end_time: str, ctx: Context) -> str:
        """
        Fetch the funding payment history for a specific user account.
    
        Parameters:
            account_address (str): The Hyperliquid account address (e.g., '0xcd5051944f780a621ee62e39e493c489668acf4d').
            start_time (str): The start time for the funding history in ISO 8601 format (e.g., '2025-01-01T00:00:00Z').
            end_time (str): The end time for the funding history in ISO 8601 format (e.g., '2025-12-31T23:59:59Z').
            ctx (Context): The MCP context object for accessing server state.
    
        Returns:
            str: A JSON string containing a list of funding payment records, each with details such as amount and timestamp.
                Returns a JSON string with an error message if the query fails.
        """
        try:
            start_ms = int(iso8601.parse_date(start_time).timestamp() * 1000)
            end_ms = int(iso8601.parse_date(end_time).timestamp() * 1000)
            data = info.user_funding_history(account_address, start_ms, end_ms)
            return json.dumps(data)
        except Exception as e:
            return json.dumps({"error": f"Failed to fetch user funding history: {str(e)}"})
  • A prompt helper named 'analyze_positions' that instructs the use of the 'get_user_funding_history' tool among others for analyzing user trading positions.
        base.UserMessage(f"Please analyze the trading positions for account {account_address}:"),
        base.UserMessage("Use the get_user_state, get_user_open_orders, get_user_trade_history, get_user_funding_history, and get_user_fees tools to fetch data."),
        base.AssistantMessage(
            "I'll analyze the user's trading positions, open orders, trade history, funding payments, and fees to provide insights on risk and performance."
        )
    ]
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only minimally addresses behavior. It mentions the return format (JSON string with records or error) but lacks details on permissions, rate limits, pagination, or what constitutes a 'failed query'. For a data retrieval tool with zero annotation coverage, this is insufficient disclosure.

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 well-structured and front-loaded with the core purpose, followed by organized parameter and return sections. Every sentence adds value: the opening statement defines scope, parameter explanations provide essential format details, and the return statement clarifies output behavior. No wasted words.

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 does an adequate job covering parameters and basic return format. However, for a tool that retrieves financial history data, it lacks details about authentication requirements, rate limiting, error scenarios beyond 'fails', and how results are structured (e.g., pagination, sorting). The context signals indicate moderate complexity that warrants more completeness.

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?

With 0% schema description coverage, the description fully compensates by providing detailed parameter semantics: it explains what each parameter represents (account address, start/end time), includes format examples (ISO 8601, address format), and clarifies their purpose in the context of fetching funding history. This adds significant value beyond the bare schema.

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') and resource ('funding payment history for a specific user account'), distinguishing it from siblings like get_user_fees, get_user_trade_history, and get_user_staking_rewards which handle different types of user data. 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 Guidelines3/5

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

The description implies usage for retrieving funding payment history within a time range, but provides no explicit guidance on when to use this tool versus alternatives like get_coin_funding_history or other user data tools. There's no mention of prerequisites, exclusions, or comparative context with siblings.

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