get_all_mids
Retrieve mid prices for all available coins on Hyperliquid exchange using this tool, enabling efficient access to real-time market data for analysis or trading strategies.
Instructions
Get mid prices for all coins on Hyperliquid
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/actions.ts:18-23 (handler)The main handler function that calls hyperliquidClient.allMids() and formats the response as MCP content.export async function getAllMids(hyperliquidClient: PublicClient) { let allMids = await hyperliquidClient.allMids(); return { content: [{ type: "text", text: JSON.stringify(allMids) }], isError: false, };
- src/tools.ts:3-11 (schema)The tool schema definition including name, description, and empty input schema.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:46-48 (registration)Registration in the CallToolRequest handler switch statement dispatching to the getAllMids handler.case "get_all_mids": { return await getAllMids(hyperliquidClient); }
- src/index.ts:78-79 (registration)Registration in the ListToolsRequest handler including ALL_MIDS_TOOL in the tools list.tools: [ALL_MIDS_TOOL, CANDLE_SNAPSHOT_TOOL, L2_BOOK_TOOL], };