Skip to main content
Glama

set_leverage

Destructive

Set leverage for a HyperLiquid perpetual asset; because the direct update endpoint returns 404, pass the leverage value to open_perp_position with the order.

Instructions

Set leverage for a specific asset on HyperLiquid. Known broken: /hl/update_leverage has returned 404 in live tests. Pass leverage on open_perp_position instead (sent with the order).

Input Schema

NameRequiredDescriptionDefault
coinYesAsset symbol
apiKeyNoGDEX API key for AES encryption
isCrossNoTrue for cross margin, false for isolated
leverageYesLeverage multiplier (1-50)
accountRefNoConnected account from gdex_connect. Supplies session key, wallet address, API key and session data so no secret is passed in chat
walletAddressNoControl wallet address
sessionPrivateKeyNoSession private key from sign-in

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields 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"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "apiKey",
      -  "walletAddress",
      -  "sessionPrivateKey",
      -  "coin",
      -  "leverage"
      -]New value: +[
      +  "coin",
      +  "leverage"
      +]
  2. First observedv4.11.3

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, so the mutation risk profile is known. The description adds a genuinely non-obvious behavioral fact: the underlying /hl/update_leverage endpoint returns 404, which no structured field conveys. It stops short of explaining failure modes or requirements for the working path (e.g. whether leverage must be set before opening).

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?

Three short sentences, zero filler, and the actionable redirect is placed immediately after the purpose statement rather than buried. Every sentence earns its place.

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 broken mutation tool with no output schema, the description covers what an agent most needs: what it nominally does and where to go instead. The remaining gap is that it doesn't say whether calling it is still safe to attempt in any environment or whether it is deprecated entirely.

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 100%, so all seven parameters (coin, leverage, isCross, apiKey, accountRef, sessionPrivateKey, walletAddress) are already documented in the schema. The description only reinforces that `leverage` is the operative value and should instead be attached to the order, which adds marginal meaning over the schema.

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 first sentence gives a specific verb and resource ('Set leverage for a specific asset on HyperLiquid'), so an agent knows the operation immediately. It does not contrast with the sizing/margin siblings like execute_cross_perp or execute_isolated_perp, but naming open_perp_position as the substitute covers the key differentiation.

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

Usage Guidelines5/5

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

Explicitly states the tool is known broken (404 in live tests) and directs the agent to pass `leverage` on open_perp_position instead. This is exactly the when/when-not/alternative guidance the dimension asks for, and it prevents a wasted failing call.

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