Close MT5 position / cancel pending order
close_mt5_orderClose an open position (fully, or partially with volume) or cancel a pending order on the user's live MT5 account, by ticket. REAL MONEY: only call this after the user explicitly approved closing/cancelling the exact ticket. The tool auto-detects position vs pending order from the latest snapshot (CLOSE_POSITION / PARTIAL_CLOSE / CANCEL_ORDER). Confirm the result with get_my_mt5_account. Requires a personal SocialForex API token. Create one at /mt5 (section "Connect an AI assistant (MCP)") and add it to the MCP client as header Authorization: Bearer sfmcp_....
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": {
"ticket": "<ticket>"
},
"name": "close_mt5_order"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticket | Yes | Ticket of the position or pending order (from get_my_mt5_account) | |
| volume | No | Lots to close for a partial close; omit to close the whole position. Ignored for pending orders. |