Skip to main content
Glama

hl_swap_collateral

Destructive

Swap collateral between Hyperliquid clearinghouses or perpetual DEXes (HIP-3) to rebalance margin or fund trading across venues.

Instructions

Swap collateral between HL clearinghouses/perp DEXes (HIP-3). Pass apiKey, walletAddress, sessionPrivateKey, fromToken, toToken, amount or a pre-built computedData.

Input Schema

NameRequiredDescriptionDefault
toDexNo
amountNo
apiKeyNo
fromDexNo
toTokenNo
fromTokenNo
accountRefNoConnected account from gdex_connect. Supplies session key, wallet address, API key and session data so no secret is passed in chat
computedDataNo
walletAddressNo
sessionPrivateKeyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.12.0
    • addedInput schema / properties / accountRef
      Added value: +{
      +  "description": "Connected account from gdex_connect. Supplies session key, wallet address, API key and session data so no secret is passed in chat",
      +  "type": "string"
      +}
  2. First observedv4.11.3

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=true and openWorldHint=true, so the agent knows this is an irreversible-looking write in an open world. The description adds that credentials (apiKey, walletAddress, sessionPrivateKey) are needed and that a pre-built computedData path exists, which is useful beyond the annotations, but it says nothing about what collateral movement actually occurs, atomicity, or failure modes.

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?

Two sentences, purpose front-loaded ahead of the input instructions, with no filler. The second sentence is essentially a parameter list, but it is compact and does carry information.

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

Completeness2/5

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

For a destructive, open-world mutation tool with ten parameters and no output schema, the description is too thin: it does not explain the mechanics of the clearinghouse/DEX swap, whether the operation is atomic or reversible, or how fromDex/toDex should be chosen. It also mildly conflicts with the schema's accountRef guidance, which steers users away from passing secrets in chat while the description tells them to pass apiKey and sessionPrivateKey.

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

Parameters3/5

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

Schema coverage is only 10% (only accountRef is documented), so the description must compensate, and it does name seven of the ten parameters and clarifies the two mutually exclusive input modes (individual fields vs computedData). However fromDex, toDex and accountRef are left unexplained, and it never mentions that no parameters are required.

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?

States a specific verb (swap) plus resource (collateral) and scope (between HL clearinghouses/perp DEXes, HIP-3), which distinguishes it from sibling flows like perp_deposit and perp_withdraw. It stops short of naming a sibling alternative, so it is clear but not maximally differentiating.

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?

There is no when-to-use or when-not-to-use guidance and no named alternative among the many deposit/withdraw/bridge siblings. The only directive is about how to supply inputs, which is parameter guidance rather than usage context.

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

Deploy Server

Other Tools