Skip to main content
Glama
kukapay

hyperliquid-info-mcp

get_candles_snapshot

Fetch historical candlestick data for a specific cryptocurrency within a defined time range to analyze price movements and trading volume.

Instructions

Fetch the candlestick data snapshot for a specific coin.

Parameters:
    coin_name (str): The trading symbol (e.g., 'BTC', 'ETH').
    interval (str): The candlestick interval (e.g., '1m', '5m', '1h').
    start_time (str): The start time for the candles in ISO 8601 format (e.g., '2025-01-01T00:00:00Z').
    end_time (str): The end time for the candles 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 candlestick data, each with open, high, low, close, volume, and timestamp.
        Returns a JSON string with an error message if the query fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coin_nameYes
intervalYes
start_timeYes
end_timeYes

Implementation Reference

  • main.py:192-214 (handler)
    The handler function implementing the get_candles_snapshot tool. It fetches candlestick data from the Hyperliquid Info API using the provided parameters, converts timestamps to milliseconds, and returns JSON data or an error message. The @mcp.tool() decorator registers it as an MCP tool.
    @mcp.tool()
    async def get_candles_snapshot(coin_name: str, interval: str, start_time: str, end_time: str, ctx: Context) -> str:
        """
        Fetch the candlestick data snapshot for a specific coin.
    
        Parameters:
            coin_name (str): The trading symbol (e.g., 'BTC', 'ETH').
            interval (str): The candlestick interval (e.g., '1m', '5m', '1h').
            start_time (str): The start time for the candles in ISO 8601 format (e.g., '2025-01-01T00:00:00Z').
            end_time (str): The end time for the candles 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 candlestick data, each with open, high, low, close, volume, 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.candles_snapshot(coin_name, interval, start_ms, end_ms)
            return json.dumps(data)
        except Exception as e:
            return json.dumps({"error": f"Failed to fetch candles snapshot: {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 candlestick data or error message) and implies a read-only operation ('fetch'), but lacks details on rate limits, authentication needs, data freshness, or error handling beyond a generic mention. It adds some context but doesn't fully compensate for the absence of annotations.

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 appropriately sized and front-loaded, starting with a clear purpose statement followed by structured parameter and return sections. Every sentence adds value: the first defines the tool, the parameter list explains inputs with examples, and the return section details output format. There's no wasted text, and it's well-organized for quick comprehension.

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 the complexity (4 parameters, no annotations, no output schema), the description is moderately complete. It covers parameter semantics and return format adequately, but lacks behavioral context like error conditions, rate limits, or data source details. For a financial data tool with multiple parameters, it should provide more guidance on usage constraints and sibling tool differentiation to be fully complete.

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% description coverage. It explains each parameter's purpose with examples (e.g., 'coin_name' as trading symbol, 'interval' as candlestick interval, time formats), clarifying semantics that the schema alone doesn't provide. This compensates well for the low schema coverage, though it doesn't cover all potential nuances like valid interval values.

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 candlestick data snapshot for a specific coin.' It specifies the verb ('fetch'), resource ('candlestick data snapshot'), and scope ('for a specific coin'), which is clear and specific. However, it doesn't explicitly differentiate from sibling tools like 'get_l2_snapshot' or 'get_user_trade_history', which might also retrieve financial data.

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 sibling tools or contexts where other tools might be more appropriate, such as using 'get_user_trade_history' for user-specific trades or 'get_l2_snapshot' for order book data. There's no explicit when/when-not or alternative usage 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