modify_position
Updates the SL/TP of an open position on a crypto exchange or FOREX/MT5. AT LEAST ONE of new_sl/new_tp must be given. SL CANNOT BE REMOVED (the mandatory-SL rule stands). Logic: long requires new_sl < mark < new_tp, short the reverse. idempotency_key is REQUIRED.
If you send only ONE side, the other keeps the position's CURRENT value — the side
you omit is NOT deleted. If several MT5 positions are open on the same symbol,
`ticket` becomes REQUIRED; while it is ambiguous, NONE are modified.
get_portfolio_context shows the current SL/TP of each position.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": {
"venue": "<venue>",
"symbol": "<symbol>",
"side": "<side>",
"idempotency_key": "<idempotency_key>"
},
"name": "modify_position"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | 'buy' (long) or 'sell' (short). The side the user stated. | |
| venue | Yes | Exchange/venue name — must be one of the user's CONNECTED accounts (e.g. binance, bybit, okx, mt5, paper). A venue that is not connected is rejected with VENUE_NOT_CONNECTED. | |
| new_sl | No | New SL price. SL CANNOT BE REMOVED (0/negative is rejected) - the mandatory-SL rule stands. At least one of new_sl or new_tp must be given. | |
| new_tp | No | New TP price. At least one of new_sl or new_tp must be given. | |
| symbol | Yes | Trading symbol, e.g. BTCUSDT, ETHUSDT, EURUSD. | |
| ticket | No | FOREX/MT5 only: the ticket number of the position this action targets (the 'ticket' field on forex positions in get_portfolio_context). REQUIRED when several positions are open on the same symbol — if which one is meant is not certain, nothing is done. May be left empty when there is only one position. | |
| account | No | TARGET ACCOUNT — the account this call acts on (for place_order/simulate_order the account the order is opened in; for close/modify the account holding the position). For MT5 the login number (e.g. '12345678'), for exchanges the account label (e.g. 'Binance2'). Copy it EXACTLY from the 'account' field in the get_portfolio_context output. REQUIRED when the user has more than one account in the same market: if left empty the action is NOT performed and the user is asked which account — it is never silently applied to the default/primary account. | |
| idempotency_key | Yes | Client-generated unique idempotency key (min 8 characters). Reuse the SAME key when retrying the same action — the stored response is replayed and the action is NOT performed a second time. |