Skip to main content
Glama

Prepare a GMX market-order transaction (non-custodial)

prepare_gmx_order
Read-onlyIdempotent

Build an unsigned on-chain transaction to open a new perpetual position on GMX v2 (Arbitrum). Returns transaction fields ready for the caller to sign with their own wallet. This is NOT a message to sign — it is a full Ethereum transaction. Requires the caller to have approved the GMX Router for USDC collateral spending (a separate one-time approve() call).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sideYesPosition direction.
assetYesAsset symbol (e.g. 'WIF', 'ETH', 'BTC', 'SOL').
walletYes0x… Arbitrum wallet address (the order receiver — your wallet).
leverageYesLeverage multiplier (1x to 10x).
workPacketIdNoOptional. A vealth.net EWP work packet id (from find_work) to pledge this trade's UI fee toward. Moves no money now — records intent only. Funding still requires a separate, later, confirmed payment, exactly like any other funder.
collateralUsdYesCollateral amount in USD (must be > 0 and ≤ $5).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okNo
toolNo
fundedNo
payUsdNo
workIdNo
claimIdNo
claimableNo
next_callNo
proofRuleNo
fulfillableByNo
definitionOfDoneNo
needs_from_callerNo
notClaimableReasonNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / claimable
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / notClaimableReason
      Added value: +{
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "claimId": {
      +      "type": "string"
      +    },
      +    "definitionOfDone": {
      +      "type": [
      +        "object",
      +        "array",
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "fulfillableBy": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "funded": {
      +      "type": "boolean"
      +    },
      +    "needs_from_caller": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "next_call": {
      +      "type": "object"
      +    },
      +    "ok": {
      +      "type": "boolean"
      +    },
      +    "payUsd": {
      +      "type": "number"
      +    },
      +    "proofRule": {
      +      "type": "string"
      +    },
      +    "tool": {
      +      "type": "string"
      +    },
      +    "workId": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  3. Added

TDQS

A4.5/5.0
Behavior5/5

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

This tool's description goes well beyond the annotations. It discloses that the output is an unsigned Ethereum transaction, not a message, and it flags the approval requirement. These are critical behavioral traits not captured by readOnlyHint, openWorldHint, or idempotentHint, making the description the primary source for these details.

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 compact and front-loaded: the first sentence conveys the core function, the second clarifies the output type, and the third adds the critical prerequisite. There is no filler or repetition.

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

Completeness5/5

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

Given the presence of an output schema, the description does not need to explain return values. It covers the key aspects: what it does, the output nature, the prerequisite, and the network (Arbitrum). Nothing an agent needs to call it correctly is missing.

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 description coverage is 100%, so the schema already explains every parameter (side, asset, wallet, leverage, collateralUsd, workPacketId). The description adds marginal context by noting the approval requirement relevant to collateralUsd, but it does not clarify individual parameter formats or constraints beyond what the schema provides.

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: 'Build an unsigned on-chain transaction to open a new perpetual position on GMX v2 (Arbitrum).' It clearly distinguishes itself from the sibling submit_gmx_order by the explicit 'prepare' vs. 'submit' pairing, and it enumerates the exact output ('transaction fields ready for the caller to sign').

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 a clear context: it prepares a transaction for the caller to sign, and it explicitly notes the required approval prerequisite. It does not explicitly name the alternative (submit_gmx_order), but the 'prepare' nomenclature and the statement 'ready for the caller to sign' imply when to use this versus a submitting tool.

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