Skip to main content
Glama

get_user_state

Query trading positions, margin details, and withdrawable balance for Hyperliquid accounts to monitor portfolio status and risk exposure.

Instructions

Query user state including trading positions, margin, and withdrawable balance. Parameters: account_address (str): The Hyperliquid account address (e.g., '0xcd5051944f780a621ee62e39e493c489668acf4d'). check_spot (bool, optional): If True, queries spot user state; otherwise, queries perpetuals state. Defaults to False. ctx (Context, optional): The MCP context object for accessing server state. Returns: str: A JSON string containing the user state, including a list of positions (with symbol, size, entry_price, current_price, unrealized_pnl), margin_summary, and withdrawable balance. Returns a JSON string with an error message if the query fails.

Input Schema

NameRequiredDescriptionDefault
account_addressYes
check_spotNo

Input Schema (JSON Schema)

{ "properties": { "account_address": { "title": "Account Address", "type": "string" }, "check_spot": { "default": false, "title": "Check Spot", "type": "boolean" } }, "required": [ "account_address" ], "type": "object" }

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