market_price
Get current mark price for any trading pair on Hyperliquid. Supports standard crypto symbols and builder dex market formats like xyz:SILVER.
Instructions
Get current mark price for any trading pair on Hyperliquid. Use standard symbols (BTC, ETH, SOL) or builder dex format (xyz:SILVER, km:OIL, cash:TSLA).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| useToonFormat | No | Return data in compact toon format (default: true). Set to false for standard JSON. | |
| symbol | Yes | Trading pair symbol (e.g. BTC, ETH, SOL). For builder dex markets use prefix:COIN format (e.g. xyz:SILVER, km:OIL, cash:TSLA) |
Implementation Reference
- src/index.ts:30-38 (registration)market_price is listed as a free-tier tool, meaning it's available without an API key.
const FREE_TIER_TOOLS = new Set([ 'pulse_global_stats', 'pulse_market_overview', 'list_markets', 'market_price', 'market_orderbook', 'pulse_most_traded_coins', 'live_long_short_ratio', ]); - src/index.ts:459-463 (schema)Input schema for market_price: accepts useToonFormat (boolean) and symbol (string, 1-20 chars) for the trading pair.
inputSchema: { useToonFormat: useToonFormatSchema, symbol: z.string().min(1).max(20).describe("Trading pair symbol (e.g. BTC, ETH, SOL). For builder dex markets use prefix:COIN format (e.g. xyz:SILVER, km:OIL, cash:TSLA)"), }, }, - src/index.ts:464-465 (handler)Handler for market_price: calls the API endpoint /market/price/{symbol} after normalizing the coin symbol (uppercasing and handling builder dex prefix format).
async ({ useToonFormat, symbol }) => toolResult(await callAPI(useToonFormat, `/market/price/${normalizeCoin(symbol)}`)) ); - src/index.ts:455-465 (registration)Registration of the market_price tool on the MCP server, with description, input schema, and handler function.
if (shouldRegister("market_price")) server.registerTool( "market_price", { description: "Get current mark price for any trading pair on Hyperliquid. Use standard symbols (BTC, ETH, SOL) or builder dex format (xyz:SILVER, km:OIL, cash:TSLA).", inputSchema: { useToonFormat: useToonFormatSchema, symbol: z.string().min(1).max(20).describe("Trading pair symbol (e.g. BTC, ETH, SOL). For builder dex markets use prefix:COIN format (e.g. xyz:SILVER, km:OIL, cash:TSLA)"), }, }, async ({ useToonFormat, symbol }) => toolResult(await callAPI(useToonFormat, `/market/price/${normalizeCoin(symbol)}`)) );