Execute Trade
execute_tradeMoney-moving broker trade (may place a real order). Optional instance_id for algo-tracked live instance; omit for on-demand on broker_account_id/default. If mcp_require_confirm, returns pending_confirmation — Confirm in Gogi Activity. Use close_positions to flatten rather than inventing a sell quantity. order_type limit/stop/stop_limit need limit_price and/or stop_price; supported types depend on the broker (Alpaca all; TradeLocker market/limit/stop; Coinbase, Kraken, OANDA, Schwab market/limit; others market) — unsupported types are refused, never sent as market. Pass a unique client_order_id so a retried call cannot place a second order. Forex/CFD quantity is in lots.
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>",
"quantity": "<quantity>"
},
"name": "execute_trade"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | Order direction. | |
| symbol | Yes | Tradable ticker or instrument symbol. | |
| quantity | Yes | Positive units, contracts, or base-asset quantity to trade. | |
| stop_loss | No | Absolute stop-loss price attached to this ENTRY (Alpaca, TradeLocker). Buy: below entry; sell: above. | |
| order_type | No | Default market. | |
| stop_price | No | Trigger price; required for stop and stop_limit. | |
| instance_id | No | Live trading instance id (list_instances). Optional — omit for direct on-demand trading on the broker account. | |
| limit_price | No | Required for limit and stop_limit. | |
| take_profit | No | Absolute take-profit price attached to this ENTRY (Alpaca, TradeLocker). Buy: above entry; sell: below. | |
| time_in_force | No | For non-market orders; default gtc. | |
| linked_algo_id | No | Optional LinkedAlgo id when multiple agent algos share the instance. Only applicable if instance_id is provided. | |
| client_order_id | No | Your idempotency key (letters, digits, _ -; max 48). Reusing it within 24h returns duplicate_client_order_id instead of a new order. | |
| broker_account_id | No | account_ref from list_brokers (e.g. "alpaca-paper-93461") for the account the user picked. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| message | No | ||
| success | No |