Skip to main content
Glama
talkincode

HyperLiquid MCP Server

by talkincode

market_close_position

Close all open positions for a specified trading pair at the current market price. Automatically calculates the required side and size to exit the entire position.

Instructions

Close all positions for a coin at market price using HyperLiquid's market_close

Args: coin: Trading pair (e.g., "BTC", "ETH") client_order_id: Optional client order ID for tracking

Note: This closes ALL positions for the specified coin. HyperLiquid's market_close method automatically determines the correct side and size to close all positions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYes
client_order_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that the tool uses HyperLiquid's market_close method and automatically determines the correct side and size to close all positions. It does not mention prerequisites or risks like slippage, but the core behavioral trait (closing everything) is clearly stated.

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?

The description is short and well-structured: a one-sentence summary, an Args list, and a clarifying Note. Each sentence adds value, and the parameter explanations justify their inclusion given the empty schema descriptions.

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?

The tool is simple (2 params, no nested objects), and an output schema exists, so return values are covered elsewhere. The description covers purpose, behavior, and parameter meanings. It lacks explicit comparison to the 'close_position' sibling, but that is a usage guideline gap rather than a completeness gap.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It does so by explaining 'coin' as a trading pair with examples and 'client_order_id' as an optional tracking ID. This provides useful meaning beyond the bare schema, though it could include more format details.

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 clearly states the action: 'Close all positions for a coin at market price' and explicitly emphasizes 'ALL positions' twice. It distinguishes from siblings by the 'all' scope, which is a key differentiator from the 'close_position' sibling that likely closes a single position.

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

Usage Guidelines4/5

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

The description provides clear context that this tool closes all positions for a specified coin, implying when it should be used over a single-position closer. However, it does not explicitly name alternatives or provide when-not-to-use guidance, so it lacks the explicit exclusions of a 5.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/talkincode/hyperliquid-mcp-python'

If you have feedback or need assistance with the MCP directory API, please join our Discord server