Skip to main content
Glama

preview_order

Read-only

Use this BEFORE place_order whenever the user wants to open a position: it validates and sizes the order (fresh est. entry, size after rounding, est. liquidation, TP/SL sanity, MCP caps) WITHOUT placing anything, and shows a proposal card the user can confirm from. Read-only and always safe to call. It also says what the account still needs before place_order can go through (agent trading off, no approved trading agent, or the one-time platform-fee approval): relay that to the user and wait for them instead of calling place_order. If the user confirms, call place_order with the same arguments.

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": {
      "symbol": "<symbol>",
      "side": "<side>",
      "margin_usd": "<margin_usd>"
    },
    "name": "preview_order"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideYesPosition direction
symbolYesHyperliquid perp coin symbol, e.g. BTC, ETH, SOL (not BTCUSDT)
leverageNoLeverage multiplier
stop_lossNoStop-loss trigger price
margin_usdYesUSDC margin to commit. Position notional = margin × leverage
order_typeNoExecution typemarket
limit_priceNoRequired when order_type is limit
margin_modeNoMargin modecross
take_profitNoTake-profit trigger price

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/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 reinforces this with 'WITHOUT placing anything' and 'always safe to call' rather than contradicting it. Beyond that it discloses non-obvious behavior the annotations cannot convey: the proposal-card confirmation flow and the three account-level blockers (agent trading off, no approved trading agent, one-time platform-fee approval) that must be surfaced to the user.

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 imperative and the before-place_order routing are front-loaded, and every sentence carries operational content. It is a dense run-on paragraph, however, and 'Read-only and always safe to call' partially restates what the readOnlyHint/destructiveHint annotations already provide.

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 9-parameter tool with no output schema, the definition covers the behavioral contract well: what is computed, that nothing is committed, what the user sees (a proposal card), and what preconditions can block the follow-up order. The one gap is the shape of the returned estimates, which the agent must infer.

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 enums, defaults, ranges, and the margin × leverage relationship are already fully documented in the schema. The description adds only one semantic point beyond that — the same argument set is reused verbatim for place_order — and says nothing about how stop_loss/take_profit are sanity-checked or how rounding affects the committed size.

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 — 'validates and sizes the order' — and enumerates exactly what is computed (estimated entry, size after rounding, liquidation, TP/SL sanity, MCP caps) while asserting it places nothing. It explicitly contrasts itself with the sibling place_order, so an agent can distinguish the two without opening either schema.

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?

It gives an explicit trigger ('BEFORE place_order whenever the user wants to open a position') and an explicit handoff path ('If the user confirms, call place_order with the same arguments'). It also states a when-NOT-to-proceed rule: relay missing account prerequisites to the user and wait rather than calling place_order.

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