get_perp_dexs
Retrieve metadata about perpetual markets on Hyperliquid DEX, including trading pairs and contract details like symbol and tick size.
Instructions
Retrieve metadata about perpetual markets available on the Hyperliquid decentralized exchange.
Parameters:
ctx (Context): The MCP context object for accessing server state.
Returns:
str: A JSON string containing metadata about perpetual markets, including a list of trading pairs and their
contract details (e.g., symbol, tick size, contract type). Returns a JSON string with an error message if
the query fails.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:104-122 (handler)The handler function for the 'get_perp_dexs' tool. It is registered via the @mcp.tool() decorator and implements the core logic by calling info.meta() from the Hyperliquid SDK to retrieve perpetual market metadata and returns it as a JSON string, with error handling.@mcp.tool() async def get_perp_dexs(ctx: Context) -> str: """ Retrieve metadata about perpetual markets available on the Hyperliquid decentralized exchange. Parameters: ctx (Context): The MCP context object for accessing server state. Returns: str: A JSON string containing metadata about perpetual markets, including a list of trading pairs and their contract details (e.g., symbol, tick size, contract type). Returns a JSON string with an error message if the query fails. """ try: data = info.meta() # Use meta() as perp_dexs is not a valid SDK method return json.dumps(data) except Exception as e: return json.dumps({"error": f"Failed to fetch perpetual DEXs: {str(e)}"})