Skip to main content
Glama

perp_open_long

Destructive

Open a leveraged LONG perp position on Drift (non-custodial).

Returns an UNSIGNED base64 transaction for your wallet to sign + broadcast, plus entry/liquidation/margin estimates. market e.g. SOL-PERP. size_usd is notional USD; leverage up to the market max. TP/SL are informational in the build — place them as trigger orders after the position opens. The fee is charged on size_usd notional past the daily free tier (x402 payment_header).

jurisdiction: your ISO-3166-1 alpha-2 country code, self-declared -- perps are geo-gated (CFTC posture: no US persons, unknown jurisdiction DENIED). Pass it once here (or via declare_jurisdiction/trade_equity) and it is remembered for 90 days; every perps/short/leverage call is denied until declared.

idempotency_key (optional): a client-generated UUID. Retrying with the same key + same args replays the original result instead of re-opening the position. Reuse the SAME key across the build call and its signed_transaction completion call -- the two legs dedupe independently (the completion leg is namespaced under its own storage key, matching jupiter_swap's build/broadcast pattern), so this never raises IDEMPOTENCY_CONFLICT; a NEW key means a genuinely new order.

signed_transaction / verify (two-phase execution): re-call this tool with the SIGNED base64 tx and Crank broadcasts it, then awaits on-chain confirmation and re-reads the perp position -- the response carries a real verification block ({confirmed, slot, post_state, expected_vs_actual}). Gate follow-on decisions on verification.confirmed, never on tx_signature alone. verify=false skips only the confirmation wait.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipNo
marketYes
verifyNo
leverageYes
size_usdYes
caller_idNo
jurisdictionNo
pay_in_crankNo
payment_headerNo
wallet_addressYes
idempotency_keyNo
stop_loss_priceNo
allow_unverifiedNo
take_profit_priceNo
signed_transactionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

TDQS

A4.5/5.0
Behavior5/5

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

The description goes well beyond the sparse annotations. It discloses non-custodial transaction signing, the exact two-phase build/broadcast flow, fee mechanics, the 90-day jurisdiction memory, geo-denial policy, idempotent replay semantics, and verification response content. This aligns with destructiveHint=true and provides materially useful operational context.

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 long, but it is dense and sectioned by bolded parameter names, making it scannable. The first line delivers the core purpose. Some idempotency nuance is verbose, but it is justified by the risk of duplicate on-chain orders.

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 15-parameter, non-custodial, multi-phase perp tool, the description is nearly complete. It covers required fields, return behavior, geo constraints, idempotency, verification, and when to trust confirmation. Minor gaps include the unidirectional meaning of allow_unverified and pay_in_crank, and there is no explicit mention of the output schema's detailed shape, though the description includes the key verification block fields.

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?

Given 0% schema description coverage, the prose does heavy lifting: market example, notional size_usd, leverage limits, jurisdiction syntax/expiry, idempotency_key replay rules, signed_transaction/verify phase behavior, and TP/SL informational role are all explained. Some parameters like allow_unverified, pay_in_crank, caller_id, and ip remain undocumented, so it is not perfect, but the critical execution parameters are very well covered.

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 operation: open a leveraged LONG perp position on Drift, returns an unsigned base64 transaction, and gives entry/liquidation/margin context. It clearly differentiates from sibling perp_open_short and other perp order tools by direction and scope.

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?

Strong operational guidance: TP/SL are informational and must be placed after opening, jurisdiction is mandatory and geo-gated, idempotency key must be reused across build/completion, and gate decisions on verification.confirmed rather than tx_signature. It lacks an explicit paragraph naming alternatives like perp_open_short or place_perp_order, but the LONG framing makes the primary use case unambiguous.

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

B3.2/5.0
Disambiguation2/5

Multiple tools overlap significantly: close_perp_position vs perp_close, get_leaderboard vs get_score_leaderboard vs get_strategy_leaderboard, get_venue_status vs get_all_venues_status, send_token_social vs bulk_send_social, and get_crank_score vs get_score. Several read-only tools have nearly identical purposes, and the descriptions do not always clarify boundaries.

Naming Consistency4/5

Most tools follow a consistent verb_noun snake_case pattern (get_balances, create_strategy, set_alert, list_webhooks). However, there are deviations like 'lst_swap', 'jupiter_swap', 'flash_loan', 'sr_backtest', and the use of both 'get_' and 'list_' for reads, plus category prefixes like 'perp_' and 'strategy_' that vary in order. Overall still readable and predictable.

Tool Count1/5

177 tools is an extreme count for any server, far exceeding the 25+ threshold for 'too many'. Even a full DeFi platform does not need this many separate operations; the surface is overwhelming and clearly not well-scoped.

Completeness3/5

The domain (Solana DeFi trading) is covered extensively across swaps, perps, lending, staking, strategies, signals, and support. However, there are notable gaps: no lend_withdraw, no direct way to close a lending position, no spot order cancellation (though aggregator-based swaps may not need it), and a general lack of tiered account management. The huge number of tools makes it hard to identify missing lifecycle steps.

Resources