Skip to main content
Glama
mektigboy

Hyperliquid MCP Server

by mektigboy

get_all_mids

Retrieve mid prices for all cryptocurrencies on the Hyperliquid exchange to access current market valuation data.

Instructions

Get mid prices for all coins on Hyperliquid

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the tool logic: fetches all mids using the Hyperliquid client's allMids method and returns a formatted response.
    export async function getAllMids(hyperliquidClient: PublicClient) { let allMids = await hyperliquidClient.allMids(); return { content: [{ type: "text", text: JSON.stringify(allMids) }], isError: false, }; }
  • Tool schema definition including name, description, and input schema (empty object since no parameters are required).
    export const ALL_MIDS_TOOL: Tool = { name: "get_all_mids", description: "Get mid prices for all coins on Hyperliquid", inputSchema: { type: "object", properties: {}, required: [], }, };
  • src/index.ts:75-80 (registration)
    Registers the get_all_mids tool (as ALL_MIDS_TOOL) in the MCP server's ListToolsRequestHandler.
    server.setRequestHandler(ListToolsRequestSchema, async () => { console.error("Received ListToolsRequest"); return { tools: [ALL_MIDS_TOOL, CANDLE_SNAPSHOT_TOOL, L2_BOOK_TOOL], }; });
  • src/index.ts:46-48 (registration)
    Dispatches incoming CallToolRequests for "get_all_mids" to the getAllMids handler function.
    case "get_all_mids": { return await getAllMids(hyperliquidClient); }

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/mektigboy/server-hyperliquid'

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