Skip to main content
Glama
kukapay

hyperliquid-info-mcp

get_perp_metadata

Fetch metadata for perpetual markets on Hyperliquid exchange, including trading pairs and contract details like symbol and tick size.

Instructions

Fetch metadata about perpetual markets on the Hyperliquid exchange.

Parameters:
    include_asset_ctxs (bool, optional): If True, includes asset contexts with metadata. Defaults to False.
    ctx (Context, optional): The MCP context object for accessing server state.

Returns:
    str: A JSON string containing metadata about perpetual markets, including trading pairs and contract details
        (e.g., symbol, tick size). Returns a JSON string with an error message if the query fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
include_asset_ctxsNo

Implementation Reference

  • main.py:340-356 (handler)
    The handler function that implements the get_perp_metadata tool. It fetches perpetual market metadata from the Hyperliquid Info SDK (using meta() or meta_and_asset_ctxs() based on the parameter), converts it to JSON, and handles exceptions.
    async def get_perp_metadata(include_asset_ctxs: bool=False, ctx: Context=None) -> str:
        """
        Fetch metadata about perpetual markets on the Hyperliquid exchange.
    
        Parameters:
            include_asset_ctxs (bool, optional): If True, includes asset contexts with metadata. Defaults to False.
            ctx (Context, optional): The MCP context object for accessing server state.
    
        Returns:
            str: A JSON string containing metadata about perpetual markets, including trading pairs and contract details
                (e.g., symbol, tick size). Returns a JSON string with an error message if the query fails.
        """
        try:
            data = info.meta_and_asset_ctxs() if include_asset_ctxs else info.meta()
            return json.dumps(data)
        except Exception as e:
            return json.dumps({"error": f"Failed to fetch perpetual metadata: {str(e)}"})
  • main.py:339-339 (registration)
    The @mcp.tool() decorator that registers the get_perp_metadata function as an MCP tool.
    @mcp.tool()
Behavior2/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 mentions that the tool returns a JSON string with an error message on failure, which is useful. However, it lacks details on rate limits, authentication requirements, data freshness, or whether this is a read-only operation (though implied by 'fetch').

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 appropriately sized and front-loaded with the core purpose. The parameter and return sections are structured clearly, though the return explanation could be slightly more concise. Every sentence adds value without redundancy.

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 tool's moderate complexity (fetching metadata), no annotations, and no output schema, the description is adequate but has gaps. It covers parameters and return format well, but lacks behavioral context like error handling details or performance characteristics. It meets minimum viability but could be more comprehensive.

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 value beyond the input schema, which has 0% description coverage. It explains the optional 'include_asset_ctxs' parameter's effect (includes asset contexts with metadata) and default value (False), and mentions the optional 'ctx' parameter for accessing server state, which is not in the schema at all. This compensates well for the schema's lack of documentation.

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 metadata') and resource ('perpetual markets on the Hyperliquid exchange'), distinguishing it from sibling tools like get_spot_metadata (for spot markets) and get_all_mids (for market IDs). The verb 'fetch' is precise and the scope is well-defined.

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 perpetual market metadata, but does not explicitly state when to use this tool versus alternatives like get_spot_metadata or get_all_mids. No guidance is provided on prerequisites, exclusions, or specific scenarios where this tool is preferred.

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