Skip to main content
Glama

Prepare order

perps_prepare_order_place
Read-only

Previews opening a position (placing an order). Read-only safety gate: runs risk checks and returns a short-lived confirmation token (~90s). Present the summary, get explicit user confirmation, then call perps_execute_operation with the token. Makes no changes itself.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "contractId": "<contractId>",
      "side": "<side>",
      "type": "<type>",
      "leverage": "<leverage>",
      "amount": "<amount>",
      "price": "<price>"
    },
    "name": "perps_prepare_order_place"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideYesDirection of the position to open.
typeYesOrder type. Only "market" can be opened — no Perps API, agent or public, takes a limit price, so a limit open has nothing to be limited by.
priceYesReference price as a decimal string. Required for market orders too: it is the slippage reference, not a limit price.
amountYesMargin (collateral) to commit, in USDT (taken from the USDT balance), as a decimal string. The contract's min_size_quote..max_size_quote applies to this value. Notional is roughly amount × leverage — exactly amount ÷ (1/leverage + taker_fee_pct), since the taker fee comes out of the margin — and base quantity is notional ÷ the slippage-widened price, floored to the contract's size_decimals.
leverageYesInteger leverage, from 1 to the contract's max_leverage. The user's choice: when they named none, ask before previewing instead of picking one yourself.
autoCloseNoOptional take-profit / stop-loss attached to the order; each leg is checked against the contract's TP/SL buffer.
contractIdYesNumeric contract id from perps_list_contracts. 0 is a real contract id, not a placeholder for "unset".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, and the description adds context annotations cannot express: the tool runs risk checks and returns a short-lived token valid ~90 seconds. The ~90s expiry is operationally critical, since an agent that stalls will need to re-run this tool, and "makes no changes itself" reinforces the safety contract.

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?

Four short sentences, front-loaded with what it does, then the token contract, then the required call sequence. No restatement of the title or filler; every sentence adds an actionable fact.

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 7-parameter tool with no output schema, it covers the essentials: it returns a token and a summary to present, nothing is mutated, and risk checks run first. It stops short of saying what the risk-check summary contains or what happens when checks fail, which is the only remaining gap.

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%, and the schema itself is unusually rich (units, leverage bounds, price as slippage reference, autoClose leg semantics), so the baseline of 3 applies. The description contributes no parameter-level meaning of its own beyond the phrase "opening a position," leaving the schema to carry all of it.

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: "Previews opening a position (placing an order)." It explicitly frames itself as a preview rather than the actual open, and names the sibling that performs the real action (perps_execute_operation), so an agent can distinguish it from perps_prepare_position_close and the other prepare_* siblings.

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

Usage Guidelines5/5

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

Gives an explicit sequence: present the summary, obtain explicit user confirmation, then call perps_execute_operation with the token. It also states the condition that makes this tool necessary (read-only safety gate before a write), leaving nothing about when to use it versus the execute sibling to inference.

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