Execute Trade
execute_tradePropose or execute a potentially money-moving trade on a connected broker. If instance_id is provided, executes on a LIVE trading instance (algo-tracked) under an agent LinkedAlgo. If instance_id is omitted, executes direct on-demand trade on the selected/default broker account. If mcp_require_confirm is true, returns pending_confirmation — user must Confirm in Gogi Activity; poll get_pending_trade_status. If false, executes immediately under policy and may place a real order. Call get_policy, get_portfolio, and get_platform_disclosure first; prefer paper accounts. Use close_positions for flattening an existing position rather than inventing a sell quantity.
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. | |
| instance_id | No | Live trading instance id (list_instances). Optional — omit for direct on-demand trading on the broker account. | |
| linked_algo_id | No | Optional LinkedAlgo id when multiple agent algos share the instance. Only applicable if instance_id is provided. | |
| broker_account_id | No | Integer `id` from list_brokers for the account the user picked (machine field). Never pass Alpaca/external account numbers. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| message | No | ||
| success | No |