Skip to main content
Glama
samklein952-hub

Hyperliquid MCP Server

get_market_info

Retrieve real-time perpetual market data including price, funding rate, open interest, and 24-hour volume for a specified trading symbol.

Instructions

Get current price, funding rate, open interest, and 24h volume for a perpetual market

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesMarket symbol (e.g. BTC, ETH, SOL)

Implementation Reference

  • The main handler function that executes the get_market_info tool logic. It retrieves market data (price, funding rate, open interest, volume) from the Hyperliquid API by calling meta_and_asset_ctxs() and matching the symbol.
    def get_market_info(self, symbol: str) -> dict[str, Any]:
        """Get price, funding rate, and 24h volume for a market."""
        metas_and_contexts = self.info.meta_and_asset_ctxs()
        meta = metas_and_contexts[0]
        ctxs = metas_and_contexts[1]
    
        for i, asset in enumerate(meta.get("universe", [])):
            if asset["name"].upper() == symbol.upper():
                ctx = ctxs[i] if i < len(ctxs) else {}
                return {
                    "symbol": asset["name"],
                    "mark_price": ctx.get("markPx", "N/A"),
                    "mid_price": ctx.get("midPx", "N/A"),
                    "oracle_price": ctx.get("oraclePx", "N/A"),
                    "funding_rate": ctx.get("funding", "N/A"),
                    "open_interest": ctx.get("openInterest", "N/A"),
                    "day_volume": ctx.get("dayNtlVlm", "N/A"),
                    "max_leverage": asset.get("maxLeverage", 1),
                }
        raise ValueError(f"Market '{symbol}' not found. Use list_markets to see available markets.")
  • The JSON schema definition for the get_market_info tool input. Defines the 'symbol' parameter as a required string with description.
    Tool(
        name="get_market_info",
        description="Get current price, funding rate, open interest, and 24h volume for a perpetual market",
        inputSchema={
            "type": "object",
            "properties": {
                "symbol": {"type": "string", "description": "Market symbol (e.g. BTC, ETH, SOL)"},
            },
            "required": ["symbol"],
        },
    ),
  • The dispatch case that routes get_market_info tool calls to the client implementation. Extracts the 'symbol' argument and calls client.get_market_info().
    case "get_market_info":
        return client.get_market_info(args["symbol"])
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions 'current' data but fails to disclose cache behavior, rate limits, authentication requirements, or error handling (e.g., invalid symbols). The term 'perpetual' hints at funding rate mechanics but lacks explicit behavioral context.

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?

Single sentence with zero waste. Front-loaded with the action verb, immediately followed by the four specific data fields. Every word earns its place—no filler or redundancy.

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?

Despite lacking an output schema, the description compensates well by enumerating the four specific return fields. For a single-parameter read operation, this is adequate coverage, though mentioning data freshness or response format would improve it further.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the parameter is well-documented in the schema itself. The description adds contextual alignment by specifying 'perpetual market,' which clarifies the domain for the symbol parameter, but does not add syntax details or format constraints beyond the schema examples.

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 provides a specific verb ('Get'), identifies the resource ('perpetual market'), and explicitly lists the four data points returned (price, funding rate, open interest, 24h volume). This clearly distinguishes it from siblings like get_orderbook (depth data) and get_account_info (user 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?

While the description implies usage by listing specific metrics, it provides no explicit guidance on when to use this versus list_markets (to discover symbols) or get_orderbook (for trading depth). No prerequisites or exclusions are mentioned.

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/samklein952-hub/hyperliquid-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server