Skip to main content
Glama

Prepare order

prepare_order

Validate an order against risk limits and estimate fill price and fees. With dry_run: true nothing else happens. Otherwise returns typed_data to sign and a prepared_id for submit_signed_order (valid 120 s). Use when you sign transactions yourself.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sideYes
sizeNoBase-asset size. Give this or notional_usd.
typeNomarket (default) or limit
marketYesMarket symbol, e.g. BTC, ETH, SOL (see get_markets)
dry_runNotrue: only validate and estimate costs
stop_lossNoMarket orders on perps: reduce-only stop-loss that closes this position when the mark price crosses trigger_price
limit_priceNoRequired for limit orders
market_typeNoperp (default) or spot; spot only for markets get_markets lists as spot
reduce_onlyNo
take_profitNoMarket orders on perps: reduce-only take-profit that closes this position when the mark price crosses trigger_price
notional_usdNoOrder value in USD. Give this or size.
slippage_bpsNoMarket orders: max slippage vs mid in basis points (default 50)
time_in_forceNoLimit orders: gtc (default), ioc, alo (post-only)
idempotency_keyNoOptional. Reuse the same value when retrying the same operation so it is not executed twice.
builder_approvalNoSigned builder-fee approval; needed once before the first real order

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / stop_loss
      Added value: +{
      +  "description": "Market orders on perps: reduce-only stop-loss that closes this position when the mark price crosses trigger_price",
      +  "properties": {
      +    "trigger_price": {
      +      "exclusiveMinimum": 0,
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "trigger_price"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / take_profit
      Added value: +{
      +  "description": "Market orders on perps: reduce-only take-profit that closes this position when the mark price crosses trigger_price",
      +  "properties": {
      +    "trigger_price": {
      +      "exclusiveMinimum": 0,
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "trigger_price"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations provide only readOnlyHint=false, so the description carries most of the burden — and it delivers real behavior: dry_run short-circuits, the normal path returns typed_data plus a prepared_id with a 120 s validity window. It omits auth requirements, failure modes when risk limits are breached, and what happens after expiry.

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?

Three sentences, each earning its place: purpose, dry_run branch, then return payload and TTL. Front-loaded with the core action and no filler.

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?

With no output schema, the description correctly explains the return payload (typed_data, prepared_id, 120 s TTL), which is the critical missing piece for a 15-parameter preparation tool. It leaves some gaps around error behavior and the one-time builder_approval prerequisite, which lives only in the schema.

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 87%, so the schema already documents nearly all 15 parameters including nested builder_approval and stop/take-profit objects. The description only touches dry_run and implicitly the risk/estimate inputs, adding little parameter meaning beyond the schema — the baseline 3 for high coverage applies.

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?

States a specific verb and resource ('validate an order against risk limits and estimate fill price and fees') and positions itself in a two-step flow by naming submit_signed_order as the consumer of its output. An agent can distinguish it from submit_signed_order and prepare_position_tpsl without opening any schema.

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?

'Use when you sign transactions yourself' gives a clear selection condition, and the dry_run sentence clarifies the read-only validation mode. It does not name the contrasting alternative (a server-side signing path) or state exclusions, so it stops short of full when/when-not guidance.

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