Skip to main content
Glama

Open or close a perps position

swop_perps_order
Destructive

Open or close a Hyperliquid perpetual position for the linked user, within their margin and leverage caps set in the Swop app. The cap is MARGIN per position (e.g. $25) with a leverage ceiling (e.g. 5x) — so $25 at 5x controls ~$125 of exposure. TWO-STEP like swop_send: call WITHOUT confirm to preview (coin, direction, margin, leverage, resulting exposure, mark price); ALWAYS show the user the leverage and exposure and get explicit confirmation; then call again with previewId and confirm: true. reduceOnly:true closes/reduces an existing position. Over-cap or no delegation returns a Swop-app approval link. Perps are leveraged and can be liquidated — make the risk clear to the user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYesPerp market symbol, e.g. "BTC", "ETH", "SOL"
confirmNotrue ONLY after the user confirmed the preview (with leverage + exposure shown)
leverageYesLeverage multiplier (capped by the user's setting and the market max)
directionYeslong = buy/up, short = sell/down
marginUsdYesMargin (collateral) in USD to commit
previewIdNoFrom the preview step
reduceOnlyNotrue to close/reduce an existing position instead of opening

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already mark destructiveHint true and readOnlyHint false; the description reinforces and enriches this by explaining the preview-before-execute pattern, cap enforcement, approval-link fallback, and liquidation risk. There is no contradiction with the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense but not bloated; each sentence adds workflow, cap, or risk context. The cap example and risk warning are useful, but the wording could be tightened slightly without losing information.

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 complex 7-parameter mutation with no output schema, it covers caps, the two-step preview/confirm flow, error routing, and risk. It lists preview return fields, though it does not describe the shape of the final confirm response, which is the main remaining 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 coverage is 100%, so the schema documents every parameter. The description adds meaning beyond the schema by explaining how margin and leverage interact ($25 at 5x controls ~$125), when confirm/previewId are required, and what reduceOnly does.

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 uses a specific verb and resource: 'Open or close a Hyperliquid perpetual position for the linked user.' It also distinguishes itself from nearby tools by scoping to perps with Swop-app caps and by explicitly referencing the two-step flow of swop_send.

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?

It provides explicit workflow instructions: call without confirm to preview, show leverage/exposure, get confirmation, then call with previewId and confirm:true. It also explains reduceOnly for closing and the over-cap/no-delegation approval-link behavior, though it does not name alternative tools for excluded cases.

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.

TDQS

A4.1/5.0
Disambiguation5/5

Every tool targets a distinct resource and action: search_markets is for discovery while get_event_markets is for a single event's full detail, and lookup_identity/search_identities, get_prices/get_price_history, and send/pay_x402_link are all clearly separated. There is no realistic pair of tools an agent would struggle to choose between.

Naming Consistency5/5

All tools follow a consistent snake_case, swop_-prefixed, verb-first pattern such as get_*, search_*, create_*, update_*, send, and pay_*. Even slightly longer names like check_predictions_access stay within the same predictable structure.

Tool Count4/5

21 tools is on the higher side, but the server covers several distinct clusters: prediction-market data, account/wallet info, identity resolution, SmartSite commerce, and payments. Each tool has a clear role, so the count is slightly over the ideal range but still reasonable for the apparent scope.

Completeness3/5

The market data and payment send flows are fairly complete, but lifecycle operations are missing: products can be created and listed but not updated or deleted, swaps are quote-only, and there is no prediction-market order execution tool. These are notable gaps, though they do not block the core send/pay and market-data workflows.