Close Positions
close_positionsClose open broker positions on an enabled Connections account (no trading instance required). Supports all asset classes: Equities, US Options, Crypto, Forex/CFDs, and Prediction Markets. Omit symbol to flatten the account (requires confirm_close_all=true when multiple opens). Prefer this over inventing sell quantities. Broker flatten closes broker exposure; algo-tracked Gogi trade engine positions for the same symbol may still need execute_trade with instance_id or delete_instance with confirm_close_positions. When mcp_require_confirm is true, returns pending_confirmation for Activity Confirm.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | No | Optional; required when multiple sides (long/short or yes/no) exist for the symbol. | |
| symbol | No | Optional — omit to close all positions on the account. | |
| quantity | No | Optional partial close; omit for full position. Requires symbol. | |
| broker_account_id | No | Integer id from list_brokers. Required when more than one enabled account exists. | |
| confirm_close_all | No | Required true when closing more than one position. Show positions_to_close from a prior response first. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| message | No | ||
| success | No |