Skip to main content
Glama

hyperliquid_prepare

hyperliquid_prepare

Builds a Hyperliquid perps action for the wallet to sign itself: market or limit order (long or short, by size or USD notional, reduce-only, post-only), cancel, leverage change, or the one-time builder-fee approval. Returns the exact action, its nonce and the EIP-712 typed data for eth_signTypedData_v4, rounded to the market's tick and lot rules, with a plain summary. When the wallet has not yet approved the builder fee, the approval comes back first. Non-custodial. Price: $0.002 USDC per call (x402).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "address": "<address>"
    },
    "name": "hyperliquid_prepare"
  }
}

Input Schema

NameRequiredDescriptionDefault
oidNoOrder id to cancel (cancel)
tifNoGtc (default), Ioc or Alo for limit orders
usdNoOrder notional in USD, converted at mid (order)
coinNoPerp, e.g. BTC, ETH, SOL (order, cancel, update_leverage)
sideNobuy/long or sell/short (order)
sizeNoOrder size in coin units (order; or use usd)
typeNoorder (default), cancel, update_leverage or approve_builder
crossNotrue for cross margin, false for isolated (update_leverage)
priceNoLimit price; omit for a market order (order)
addressYes0x wallet that will sign
leverageNoNew leverage, integer (update_leverage)
post_onlyNotrue for a maker-only limit order (order)
reduce_onlyNotrue to only reduce an existing position (order)
max_fee_rateNoApproval cap such as "0.05%" (approve_builder)
slippage_bpsNoMax slippage for market orders in basis points, 1-2000 (default 100)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

The sole annotation is readOnlyHint=false, so the description carries the real burden and does it well: it discloses the return payload (exact action, nonce, EIP-712 typed data for eth_signTypedData_v4, plain summary), the pre-submission normalization (rounded to the market's tick and lot rules), the first-call builder-fee ordering, the non-custodial key model, and the x402 price of $0.002 USDC per call. Those are behavioral facts an agent cannot infer from the annotation or schema.

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

Conciseness4/5

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

Four sentences, all substantive and front-loaded with the core purpose before the return shape, ordering behavior, and pricing. The first sentence is heavily parenthesized with the action/flag list, which slightly slows scanning, but no sentence is filler or redundant.

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?

For a 15-parameter, action-dispatching tool with no output schema, the description covers the return contract, normalization rules, and the builder-fee prerequisite, which is what an agent most needs. It stops short of describing failure modes (e.g., unapproved builder, insufficient market metadata, missing action-specific fields), which would round out completeness for a dispatcher of this size.

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?

Schema coverage is 100%, so the per-parameter descriptions already exist and the baseline would be 3. The prose still adds meaning beyond the schema: it frames size vs. USD notional as alternatives, labels the builder-fee approval "one-time" (implying idempotency the schema does not state), and ties rounding behavior to the price/size inputs. It does not, however, explain per-action parameter dependencies (which fields matter for cancel vs. update_leverage), leaving that to the inline schema hints.

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 opens with a specific verb and resource ("Builds a Hyperliquid perps action for the wallet to sign itself") and then enumerates the exact action families: market/limit order, cancel, leverage change, and one-time builder-fee approval. Critically, "for the wallet to sign itself" and "Non-custodial" distinguish it from the sibling hyperliquid_submit, which presumably broadcasts, so an agent can route correctly without inspecting schemas.

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

Usage Guidelines4/5

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

Usage context is clear: this is the step that produces signable payloads, and the conditional behavior "When the wallet has not yet approved the builder fee, the approval comes back first" tells the agent what to expect on the first call. What is missing is an explicit routing statement naming the alternative path (e.g., use hyperliquid_markets for tick rules, or hyperliquid_submit to broadcast after signing), so the when-not side is left implicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources