Skip to main content
Glama

WenLong: Hyperliquid trading for AI agents

Close position

close_position
Destructive

Close an open position at market (reduce-only). fraction in (0, 1], default 1 = the whole position.

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": {
      "coin": "<coin>"
    },
    "name": "close_position"
  }
}

Input Schema

NameRequiredDescriptionDefault
coinYesMarket name as on Hyperliquid, e.g. BTC, ETH, xyz:GOLD
fractionNo
client_order_idNoOptional idempotency id (0x + 32 hex), as for place_order.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, openWorldHint=true and readOnlyHint=false, so the risk profile is covered. The description adds genuinely new behavior beyond those flags: execution is at market (implying slippage and no price control) and the order is reduce-only (it cannot flip or increase exposure). It stops short of describing what happens if no position exists or what the call returns.

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?

Two short sentences with the action and its constraints front-loaded and the parameter default placed second. No filler, no restatement of the title, and every clause carries information an agent needs.

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

Completeness3/5

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

For a destructive, open-world trading mutation with no output schema, the definition covers the action and the fraction semantics but is silent on the result (order id? fill price? confirmation?), on failure modes such as no open position or fraction exceeding position size, and on the client_order_id idempotency behavior. Adequate to call correctly, thin on what to expect back.

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 67%, with coin and client_order_id documented in the schema. The description supplies the missing piece for fraction: its valid interval, that it defaults to 1, and that 1 means the whole position — semantics the schema does not convey since it lacks a default and an explicit description. That is real added meaning, though it is limited to one parameter.

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 states a specific verb and resource ('Close an open position') plus the execution style and constraint ('at market (reduce-only)'), which is enough to tell it apart from place_order and cancel_order without opening any schema. An agent knows exactly what this tool does.

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

Usage Guidelines3/5

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

The reduce-only and at-market qualifiers imply the usage context (exit an existing exposure rather than open a new one), and the fraction default implies the common whole-position case. However, there is no explicit when-to-use/when-not guidance, no statement of prerequisites such as an existing open position, and no named alternative for opening or partially exiting via a limit order.

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