command
Build an Autoview alert command string from structured order fields (symbol, side, quantity, type, price, trigger), or from ONE line of the Autoview trade language (line, e.g. "buy(BTCUSD, 0.2, -0.5%)"; grammar in catalog's language card), without placing an order. A line reply also carries echo, one plain sentence stating the resolved order: confirm the sentence, not the string: the output is the alert body any webhook sender POSTs to a hook URL (for TradingView, the value create_alert's message field carries). Also builds cancel/close/flat management commands via action (see entry's description). Dry-run by default: a bare call returns a preview command (appends d=1); set live:true to build a command that trades for real once the alert fires. Pass the alert field instead to check and return raw webhook command text with any key a webhook accepts. Prefer the alert tool if you also need the destination webhook, expiration, and resolution in one call. Requires your Autoview account token; live:true requires a live-scoped token. exchange is optional: pass any exchange id configured on Autoview (see the catalog tool; a bracket is refused if that exchange lists sl/tp as unsupported); omit exchange entirely to build a generic command routed by whichever exchange(s) the destination hook is linked to.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "command"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| line | No | one line of the Autoview trade language instead of the structured fields below, e.g. buy(BTCUSD, 0.2), buy(BTCUSD, 0.2, -0.5%), sell(BTCUSD, 0.2, stop(78000)), close(BTCUSD), link(buy(BTCUSD, 0.2, market), takeProfit(+500), stopLoss(-300)), link(buy(BTCUSD, 0.2, market), takeProfit(+5%), stopLoss(-3%)). Slots are symbol, size, price; a signed price is an offset from the ticker, an unsigned one is absolute; no type word = limit at the ticker; no key=value. Full card: catalog's language field. Do not combine with symbol/side/quantity/type/price/trigger/brackets. | |
| live | No | false (default) = build a dry-run preview command (appends d=1); true = build a command that places a real order when the alert fires | |
| side | No | order direction; required unless action is set, where it is an optional buy/sell filter for cancel/close (omit for flat) | |
| type | No | order type; defaults to limit at the ticker (t=limit with no price, same as a plain alert). An attached bracket needs type market explicitly. | |
| unit | No | "currency" treats quantity as a CURRENCY amount to convert to units at the resolved price (u=currency) — e.g. quantity:10 with unit:"currency" on BTC/USD buys $10 of BTC instead of 10 BTC. Only meaningful with a fixed (non-percent) quantity. | |
| alert | No | the raw command text a webhook body carries, e.g. s=BTCUSD b=buy q=0.01 fp=60000 ef=any tif=gtc; any key a webhook accepts works here, it is checked by the engine's parser and returned as-is (with d=1 leading each line unless live is true). Do not combine with line or the structured order fields. | |
| price | No | absolute limit price; required for an explicit limit, post_only, ioc, fok, and stop_limit (omit type and price for a limit at the ticker) | |
| token | No | your Autoview account token — an av_mcp_ personal access token, generate one at /account/tokens/ on the Autoview site. Omit this if your MCP client already sends it as an `Authorization: Bearer` header (Claude Code, Cursor, and most non-browser clients do this automatically once configured). | |
| action | No | manage EXISTING orders/positions on symbol instead of placing a new one: cancel = cancel open orders, close = close open positions, flat = cancel every order AND close every position (Tradovate only). When set, side (if given) is an optional buy/sell filter (not applicable to flat), and quantity/type/price/trigger/brackets/unit are ignored. | |
| symbol | No | the instrument symbol, e.g. EUR_USD, XBTUSD, BTC_USD, or the exchange-native symbol a TradingView EXCHANGE:TICKER maps to. Required unless line or alert is set | |
| trigger | No | absolute trigger (stop) price; required for stop and stop_limit | |
| exchange | No | optional — any exchange id known to Autoview (see `catalog`); a bracket is refused if that exchange lists its params as unsupported; omit entirely to skip that check | |
| priceRef | No | reference price for percent sizing and brackets | |
| quantity | No | order size: a positive number (contracts/units), or a percent-of-balance string like "50%" (1-100%). Required unless action is set. | |
| stopLoss | No | attached bracket stop-loss distance from the fill: points (10) or a percent string such as 3%; a sign, if given, must point the right way); pairs with takeProfit or a trail leg | |
| trailStop | No | auto-trail stop distance in points; requires trailActivate | |
| takeProfit | No | attached bracket take-profit distance from the fill: points (20) or a percent string such as 5%; pairs with stopLoss or a trail leg | |
| trailActivate | No | points of profit before the trail starts; required whenever trailStop is set | |
| trailFrequency | No | how often the trailing stop re-checks price; defaults to 1 if omitted | |
| sizeAgainstEquity | No | for a percent quantity, size against equity instead of available balance (y=equity) |