Skip to main content
Glama
Factor MCP Server

Factor MCP Server

Official
by FactorDAO

factor_hl_compile_close

Compile a BatchPlan to close a HyperLiquid perp position without broadcasting it, returning ordered EVM and HL operations, warnings, blockers, and notional estimates for HyperEVM execution.

Instructions

Compile (do NOT broadcast) a BatchPlan for closing a HyperLiquid perp position. If sizeUsd is omitted, defaults to a full close. Returns ordered EVM + HL Exchange ops, structured warnings / blockers, and notional estimates. Use factor_hl_close_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>"
    },
    "name": "factor_hl_compile_close"
  }
}

Input Schema

NameRequiredDescriptionDefault
vaultYesVault contract address (HyperEVM).
sizeUsdNoNotional size in USD to close. Omit for a full close (uses current position notional).
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 discloses that nothing is broadcast, describes the return payload (ordered EVM + HL Exchange ops, warnings/blockers, notional estimates), and specifies the omission default as a full close. It stops short of stating auth/vault-permission requirements or whether a compiled plan expires or persists, which matters for a plan-then-execute flow.

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?

Four short sentences, front-loaded with the core action and the non-broadcast caveat, followed by return shape and the execution alternative. Almost nothing is redundant except the sizeUsd default, which is minor.

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 three-parameter compile tool with no output schema, the description adequately covers return content, default behavior, and chain scope. The remaining gap is procedural: it doesn't explain how the returned BatchPlan is later submitted, which is arguably the most important follow-on for a compile-only tool.

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 three parameters are already documented; the description's note that omitting sizeUsd defaults to a full close repeats the schema's own wording rather than adding new meaning. It adds no guidance on instrumentId resolution formats or vault-address validity beyond what the schema says.

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 and object ("Compile... a BatchPlan") plus the exact resource scope (closing a HyperLiquid perp position), and explicitly marks it as non-broadcasting. An agent can immediately distinguish it from factor_hl_close_position, which the description names.

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 explicit when/when-not guidance: this tool compiles and does NOT broadcast, while factor_hl_close_position is named as the tool that actually executes. It also states an environment constraint (HyperEVM chain 999 only), leaving no routing ambiguity.

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