Skip to main content
Glama
alekskram

hyperliquid-agent-gateway

Liquidation Risk

liquidation_risk
Read-only

Assess a Hyperliquid perpetual account's liquidation risk using its address. Returns margin summary, liquidation prices, estimated distance, and funding drag to help manage positions.

Instructions

KEY TOOL. Liquidation risk for one perp account (clearinghouseState + userFunding): margin summary (accountValue, totalRawUsd, totalMarginUsed, withdrawable), cross maintenance margin, per-position leverage/entry/mark/unrealizedPnl and liquidationPx when the venue provides it. Positions in the LIVE clearinghouseState response carry NO markPx: mark is resolved per coin from metaAndAssetCtxs (fallback allMids) and each row says where it came from in mark_px_source ('position' | 'metaAndAssetCtxs' | 'allMids' | null). When liquidationPx is null, liq_distance_pct is an ESTIMATE from the maintenance-margin ratio (crossMaintenanceMarginUsed / marginSummary.accountValue; isolated positions use marginUsed / positionValue) - flagged 'estimated': true, liqPx stays null (honest). funding_drag totals negative funding payments from userFunding. Address must be 0x + 40 hex. Example: liquidation_risk(address="0x...")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.1

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnlyHint/openWorldHint annotations, the description discloses significant behavioral nuance: mark prices are resolved from multiple sources and tagged with mark_px_source, null liquidation price is handled honestly with an estimated flag, and funding_drag aggregates negative funding payments. This gives the agent accurate expectations about data completeness and reliability.

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 is dense but every sentence adds operational value: scope, data sources, mark resolution, estimation semantics, funding drag, and input validation. It is front-loaded with the key purpose and the only borderline item is 'KEY TOOL.' which is a useful prioritization signal.

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

Completeness5/5

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

With an output schema present, the description does not need to enumerate return values. It covers edge cases like missing liquidationPx, isolated vs cross margin behavior, fallback mark sources, and required address format, so a correct call can be constructed without external documentation.

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

Parameters5/5

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

The input schema only specifies address as a string with 0% description coverage, so the description carries the full burden. It fully compensates by stating the address must be 0x plus 40 hex characters and providing an example call, making validation unambiguous.

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

Purpose5/5

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

The description clearly identifies the resource as liquidation risk for one perp account, drawing on clearinghouseState and userFunding. It enumerates the exact margin and position fields returned, and the perp-account focus distinguishes it from spot and market-data siblings.

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

Usage Guidelines3/5

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

The description implies usage: call it when you need liquidation risk for a specific perp account, and it gives the required address format with an example. However, it never explicitly states when to prefer an alternative like wallet_balance or spot_overview, so the agent must infer selection from context.

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

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/alekskram/hyperliquid-agent-gateway'

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