Skip to main content
Glama

AlgoVesta MCP Trading

place_order

DestructiveIdempotent

Places an order. idempotency_key is REQUIRED: if the same (user, key) arrives a second time the stored response is returned and a second order is NEVER opened. scope=paper runs on the paper engine, scope=live runs through live execution. The policy wall runs server-side; a violation means a hard reject + audit entry.

Same arguments as simulate_order; a call with the arguments of a simulation places
that order. Missing required fields are returned together in ONE error.
AMOUNT FIELDS: margin_usd is the collateral, size_usd the position value.
SIZE FIELD DEPENDS ON MARKET: forex/MT5 -> `lots` (used exactly as given, never
rounded to a fixed value); crypto -> EXACTLY ONE of size_usd/margin_usd/risk_pct.
`leverage` is not used for forex (the product is unleveraged).
ACCOUNTS: when the user has several accounts in the same market (two MT5 accounts,
'Binance' + 'Binance2'), `account` selects one; without it the order is NOT placed
and the candidate accounts are returned — it never falls back to a default account.
`warnings` in the response mean the order differs from the request.

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": "place_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?

Annotations already declare destructive/openWorld/idempotent, but the description adds real behavioral depth: the stored-response replay semantics on duplicate (user, key), the server-side policy wall with hard reject plus audit entry, aggregated single-error reporting for missing fields, and the meaning of `warnings` in the response. These are non-obvious consequences an agent could not infer from the annotations alone.

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?

Front-loaded with the mandatory idempotency behavior, then blocked by concern (scope, policy, sizing, accounts, warnings). Dense without filler; the only mild redundancy is the sizing recap that the schema already covers.

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?

For an 18-parameter destructive mutation with no output schema, the description covers the cross-parameter constraints, failure modes, response fields (warnings, prefs_used), and the account-ambiguity stop condition. An agent has everything needed to decide whether and how to call it.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds cross-field semantics the schema states only per-parameter: margin_usd as collateral vs size_usd as notional, exactly-one-of size_usd/margin_usd/risk_pct, lots for forex used verbatim and never rounded, and leverage being irrelevant for forex. Some of this restates the schema, which keeps it from a 5.

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?

"Places an order" is a specific verb+resource, immediately qualified by paper vs live scope. It also draws the boundary with simulate_order ("Same arguments as simulate_order; a call with the arguments of a simulation places that order"), so an agent can separate 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 Guidelines4/5

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

The description gives explicit routing context: paper vs live engines, the required idempotency_key for retries, forex vs crypto sizing paths, and the account-disambiguation rule that blocks placement rather than defaulting. It never says outright "prefer simulate_order when the user wants no real money at risk," so the alternative-selection guidance is implied rather than stated.

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.