Skip to main content
Glama

get_all_mids

Retrieve mid prices for all available trading pairs on the exchange to access current market valuation data.

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

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • main.py:66-81 (handler)
    The async handler function implementing the get_all_mids tool. It calls info.all_mids() from the Hyperliquid SDK to fetch mid prices for all pairs and returns them as JSON, with error handling.
    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)}"})
  • main.py:65-65 (registration)
    The @mcp.tool() decorator that registers the get_all_mids function as a tool in the FastMCP server.
    @mcp.tool()

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