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)}"})

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