Skip to main content
Glama

AlgoVesta MCP Trading

simulate_order

Read-onlyIdempotent

SIMULATES an order: expected fill, margin impact, policy check result. Sends NO real order.

It has no side effects: no order is sent and no state changes (read-only). The
response carries everything a place_order call with the same arguments would use:
resolved account, entry, SL/TP (including values derived from sl_pct/tp_pct and from
saved settings via `prefs_used`), size, leverage and the policy verdict.

Missing required fields are returned together in ONE error.
AMOUNT FIELDS: margin_usd is the collateral (margin_usd=20 at 5x -> a $100 position);
size_usd is the position value (size_usd=20 -> a $20 position).
SIZE FIELD DEPENDS ON MARKET: forex/MT5 -> `lots` (used exactly as given); crypto ->
EXACTLY ONE of size_usd/margin_usd/risk_pct. `leverage` is not used for forex.

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": {
      "venue": "<venue>",
      "symbol": "<symbol>",
      "side": "<side>",
      "order_type": "<order_type>",
      "idempotency_key": "<idempotency_key>"
    },
    "name": "simulate_order"
  }
}

Input Schema

NameRequiredDescriptionDefault
slNoStop-loss PRICE. Below entry for long, above entry for short. Optional: when omitted, the user's saved SL percentage is applied (reported in `prefs_used`); `sl_pct` takes a percentage instead of a price. A value sent here overrides the saved setting. SL remains mandatory: if neither a value nor a saved setting exists, the order is NOT opened.
tpNoTake-profit PRICE. Above entry for long, below entry for short. Optional: when omitted, the user's saved TP percentage is applied (reported in `prefs_used`). A value sent here overrides the saved setting.
lotsNoFOREX/MT5 trade volume in LOTS (e.g. 0.05, 0.10, 1.5). This is how size is given for forex orders — instead of size_usd/margin_usd/risk_pct. The lot size the user stated is used EXACTLY, never rounded to a fixed value; if it falls outside the broker/account limits the order is not opened and the allowed range is reported. NOT used for crypto orders.
sideYes'buy' (long) or 'sell' (short). The side the user stated.
venueYesExchange/venue name — must be one of the user's CONNECTED accounts (e.g. binance, bybit, okx, mt5, paper). A venue that is not connected is rejected with VENUE_NOT_CONNECTED.
marketNoCRYPTO market type: 'futures' (default, leveraged perpetual) or 'spot' (unleveraged, actually buys the coin). Send 'spot' if the user says spot or if their account supports spot only; on spot leverage must be 1. NOT used for forex/MT5.
sl_pctNoSL as a PERCENTAGE (e.g. 3 = 3% away from entry). The server converts it to a price from the live entry and returns the result as `sl` with `pct_used`, so no separate price lookup is involved. Cannot be combined with `sl`. Optional: when omitted, the SL percentage saved in the user's AlgoVesta account is applied (the same default used everywhere else in the product); a value sent here overrides that setting.
symbolYesTrading symbol, e.g. BTCUSDT, ETHUSDT, EURUSD.
tp_pctNoTP as a PERCENTAGE (e.g. 5 = 5% away from entry). The server converts it to a price from the live entry and returns the result as `tp` with `pct_used`. Cannot be combined with `tp`. Optional: when omitted, the user's saved TP percentage is applied.
accountNoTARGET ACCOUNT — the account this call acts on (for place_order/simulate_order the account the order is opened in; for close/modify the account holding the position). For MT5 the login number (e.g. '12345678'), for exchanges the account label (e.g. 'Binance2'). Copy it EXACTLY from the 'account' field in the get_portfolio_context output. REQUIRED when the user has more than one account in the same market: if left empty the action is NOT performed and the user is asked which account — it is never silently applied to the default/primary account.
leverageNoLeverage (crypto). Optional: when omitted, the leverage saved in the user's panel is applied and reported in `prefs_used`. A value sent here overrides that saved setting and changes the position size. Not used for FOREX/MT5: that product is unleveraged (1x) and size is given via lots.
risk_pctNoPercentage of the account's FREE balance to use as MARGIN (0, 100]. The position value becomes margin x leverage — this is NOT risk-based sizing and the SL distance is not used in the calculation. Can be used instead of size_usd/margin_usd — EXACTLY ONE of the three.
size_usdNoPOSITION VALUE / notional (USD) — NOT the margin you put up. E.g. size_usd=100 => a $100 position (margin = 100/leverage). If the user says 'X dollars at 5x' meaning MARGIN, use margin_usd instead. Provide EXACTLY ONE of size_usd / margin_usd / risk_pct.
margin_usdNoMARGIN / collateral (USD) — the money out of your own pocket. notional = margin_usd x leverage. E.g. '$20 at 5x' => margin_usd=20 => a $100 position. This is usually what users mean by 'X dollars' with leverage. EXACTLY ONE of size_usd / margin_usd / risk_pct.
order_typeYes'market' or 'limit'. If 'limit', entry_price is REQUIRED. Live CRYPTO venues accept market orders only — a live crypto limit order is refused with live_limit_not_supported (never silently converted). Limit orders work on paper and on live MT5.
entry_priceNoLimit order entry price. REQUIRED when order_type='limit'; not used for market orders.
take_profitsNoSCALED take-profit (partial TP). A list: [{"price": 70000, "close_pct": 50}, {"price": 75000, "close_pct": 50}] — close_pct is the percentage of the position closed at that target and the TOTAL may not exceed 100%. Prices must follow target order (ascending for long, descending for short). For a single target use `tp` instead; the two cannot be sent together.
idempotency_keyYesClient-generated unique idempotency key (min 8 characters). Reuse the SAME key when retrying the same action — the stored response is replayed and the action is NOT performed a second time.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

The annotations already mark this as read-only, idempotent, non-destructive, and open-world, and the description reinforces that no order is sent and no state changes occur. It adds useful behavioral detail beyond the annotations, including the response contents, the aggregation of missing required fields into one error, and the market-dependent size rules.

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 front-loaded with the central action and no-side-effect guarantee, then uses compact sections for amount fields and market-dependent sizing. Despite covering many parameters, every sentence carries relevant information for correct invocation.

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 an 18-parameter simulation tool with no output schema, the description does a strong job covering return contents, error behavior, and critical parameter interactions. A slightly clearer statement of when to prefer this over simulate_policy would make it fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although schema description coverage is 100%, the description adds significant cross-parameter meaning: margin_usd is collateral while size_usd is position value, forex/MT5 requires lots while crypto requires exactly one of size_usd/margin_usd/risk_pct, and leverage is not used for forex. It also clarifies how sl_pct/tp_pct and saved preferences interact with explicit sl/tp values.

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: it simulates an order and returns expected fill, margin impact, and policy verdict, while sending no real order. It clearly distinguishes itself from the sibling place_order by emphasizing that no order is sent and no state changes occur.

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 makes the primary use case clear: preview what a real place_order call would do without executing it. However, it does not explicitly compare against sibling tools such as simulate_policy, nor does it state when not to use this simulation.

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.