Skip to main content
Glama
samklein952-hub

Hyperliquid MCP Server

get_account_info

Retrieve wallet balance, margin summary, and withdrawable funds for Hyperliquid exchange accounts to monitor portfolio value and manage risk.

Instructions

Get wallet balance, margin summary, and withdrawable funds

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual handler implementation that fetches account info from Hyperliquid API. Gets wallet state including margin summary, cross margin summary, and withdrawable funds.
    def get_account_info(self) -> dict[str, Any]:
        """Get wallet balance, margin, and account summary."""
        if not self.wallet_address:
            raise ValueError("HYPERLIQUID_WALLET_ADDRESS is required.")
        state = self.info.user_state(self.wallet_address)
        return {
            "address": self.wallet_address,
            "testnet": self.testnet,
            "margin_summary": state.get("marginSummary", {}),
            "cross_margin_summary": state.get("crossMarginSummary", {}),
            "withdrawable": state.get("withdrawable", "0"),
        }
  • Tool registration with MCP server. Defines the tool name, description, and input schema (no parameters required).
    Tool(
        name="get_account_info",
        description="Get wallet balance, margin summary, and withdrawable funds",
        inputSchema={"type": "object", "properties": {}, "required": []},
    ),
  • Dispatch helper function that routes the tool call to the client method. Matches the tool name and calls client.get_account_info().
    def _dispatch(client: HyperliquidClient, name: str, args: dict[str, Any]) -> Any:
        match name:
            case "get_account_info":
                return client.get_account_info()
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must carry the full burden of behavioral disclosure. It compensates for the missing output schema by listing the specific data categories returned (wallet balance, margin summary, withdrawable funds), but omits critical operational details such as rate limits, data freshness (real-time vs. cached), or scope (all sub-accounts vs. specific ones).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description consists of a single, efficient sentence with zero wasted words. It is appropriately front-loaded with the verb and immediately specifies the returned data types, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (zero parameters) and lack of output schema, the description adequately compensates by enumerating the specific financial metrics returned. It successfully communicates the tool's scope for an account information fetcher, though it could clarify whether the data covers all account types or requires specific permissions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema contains zero parameters, establishing a baseline score of 4. The description appropriately makes no parameter claims, as there are none to document.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Get') and clearly enumerates the three data categories retrieved (wallet balance, margin summary, withdrawable funds). This distinguishes it from siblings like get_market_info (market data) and get_open_orders (order data), though it could more explicitly contrast with get_positions regarding margin data overlap.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like get_positions (which may also return margin-related data) or prerequisites such as authentication requirements. It states what it does but not when an agent should invoke it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/samklein952-hub/hyperliquid-mcp'

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