Skip to main content
Glama
kukapay

hyperliquid-info-mcp

get_all_mids

Retrieve mid prices for all trading pairs on the exchange to monitor current market valuations and support trading decisions.

Instructions

Retrieve the mid prices for all trading pairs available on the exchange.

Parameters:
    ctx (Context): The MCP context object for accessing server state.

Returns:
    str: A JSON string containing a dictionary of trading pairs and their mid prices.
        Returns a JSON string with an error message if the query fails.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • main.py:65-81 (handler)
    The handler function for the 'get_all_mids' tool, decorated with @mcp.tool() for registration. It fetches mid prices for all trading pairs using the Hyperliquid Info SDK's all_mids() method and returns the result as a JSON string, with error handling.
    @mcp.tool()
    async def get_all_mids(ctx: Context) -> str:
        """
        Retrieve the mid prices for all trading pairs available on the exchange.
    
        Parameters:
            ctx (Context): The MCP context object for accessing server state.
    
        Returns:
            str: A JSON string containing a dictionary of trading pairs and their mid prices.
                Returns a JSON string with an error message if the query fails.
        """
        try:
            all_mids = info.all_mids()
            return json.dumps(all_mids)
        except Exception as e:
            return json.dumps({"error": f"Failed to fetch all mids: {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 mentions that the tool retrieves data (implying read-only, non-destructive) and describes the return format and error handling, which adds useful context. However, it lacks details on rate limits, authentication needs, or performance characteristics, leaving gaps for a tool with no annotation support.

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 in the first sentence, followed by concise sections for parameters and returns. Every sentence earns its place by providing essential information without redundancy, making it efficient and well-structured for quick understanding.

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 the tool's low complexity (0 parameters, no output schema, no annotations), the description is mostly complete. It explains the purpose, return format, and error handling. However, it could improve by addressing potential limitations or linking to siblings for more specific data, but for a simple retrieval tool, it covers the essentials adequately.

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 tool has 0 parameters, and the input schema has 100% coverage (though empty). The description correctly notes that there are no user-provided parameters, only a context object, which adds clarity beyond the schema. Since there are no parameters to document, a baseline of 4 is appropriate as the description adequately addresses the parameterless nature.

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 ('Retrieve') and resource ('mid prices for all trading pairs available on the exchange'), distinguishing it from siblings that focus on user data, metadata, or specific data types like candles or order books. It precisely defines what the tool does without being vague or tautological.

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 does not mention any context, prerequisites, or exclusions, such as when to prefer this over other data-fetching tools like get_spot_metadata or get_l2_snapshot. Usage is implied only by the purpose, with no explicit when/when-not statements.

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