Skip to main content
Glama
Factor MCP Server

Factor MCP Server

Official
by FactorDAO

factor_hl_compile_open

Compile a non-broadcast BatchPlan for opening a HyperLiquid perp position, including ordered EVM and HL operations, warnings, blockers, and margin, notional, and liquidation estimates.

Instructions

Compile (do NOT broadcast) a BatchPlan for opening a HyperLiquid perp position. Returns ordered EVM + HL Exchange ops, structured warnings / blockers, and margin/notional/liquidation estimates. Use factor_hl_open_position to actually execute. HyperEVM (chain 999) only.

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": {
      "vault": "<vault>",
      "instrumentId": "<instrumentId>",
      "sizeUsd": "<sizeUsd>",
      "isLong": "<isLong>"
    },
    "name": "factor_hl_compile_open"
  }
}

Input Schema

NameRequiredDescriptionDefault
vaultYesVault contract address (HyperEVM).
isLongYestrue = long, false = short.
sizeUsdYesNotional size in USD (must be ≥ HL min notional = $10).
leverageNoTarget leverage. Must be ≤ instrument.maxLeverage.
slippageBpsNoMax IOC slippage in basis points (0-10000).
instrumentIdYesCatalog id ("perp:main:BTC", "perp:xyz:BRENTOIL"), qualifiedSymbol, or bare ticker.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.7.9

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the burden well: it declares non-broadcast behavior, that the result is an ordered op list plus structured warnings/blockers and margin/notional/liquidation estimates, and a chain restriction. It stops short of stating prerequisites such as whether an API wallet must be registered first (cf. factor_hl_add_api_wallet) or whether a compiled plan expires.

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 tight sentences, each earning its place: the key non-broadcast constraint is front-loaded, returns are summarized, and the execution sibling is named last. No filler or restated name.

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?

With no output schema, the description usefully enumerates what comes back (ordered EVM + HL ops, warnings/blockers, margin/notional/liquidation estimates), which is the right use of that space. It is nearly complete for a six-parameter compile tool, lacking only preconditions and a hint on how to treat blockers before executing.

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 description coverage is 100%, so all six parameters (including the $10 min notional, maxLeverage bound, and slippageBps range) are already documented in the schema. The description adds only the HyperEVM chain constraint that ties to the vault parameter, so it clears the baseline but no more.

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?

States a specific verb (compile) and resource (BatchPlan for opening a HyperLiquid perp position), and explicitly contrasts itself with the executing sibling factor_hl_open_position as well as implicitly with factor_hl_compile_close. An agent can distinguish this from factor_hl_open_position and factor_hl_place_order_raw immediately.

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?

Gives an explicit when-not ('do NOT broadcast') and names the alternative ('Use factor_hl_open_position to actually execute'), plus an environment exclusion ('HyperEVM (chain 999) only'). This is the when/when-not/alternative pattern done correctly.

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