cancel_and_replace_order
Atomically cancel an existing equity, option, or crypto order and replace it with new parameters in one action, avoiding separate cancel and re-submit steps.
Instructions
Atomically cancel an existing order and replace it with new parameters.
⚠️ This modifies an existing order.
Supported for equity, option, and crypto quantity orders.
Args: order_id: UUID of the existing order to cancel and replace. order_type: MARKET, LIMIT, STOP, STOP_LIMIT, MARKET_ON_CLOSE or LIMIT_ON_CLOSE for the replacement. time_in_force: DAY or GTD. Default is DAY. quantity: New quantity for the replacement order. Mutually exclusive with amount. amount: New notional dollar amount for the replacement order. Mutually exclusive with quantity. limit_price: New limit price. Required for LIMIT, STOP_LIMIT and LIMIT_ON_CLOSE replacements. stop_price: New stop price (for STOP/STOP_LIMIT orders). expiration_time: Required when time_in_force is GTD. ISO 8601 format. account_id: Account ID. Optional if PUBLIC_COM_ACCOUNT_ID is set.
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": {
"order_id": "<order_id>",
"order_type": "<order_type>"
},
"name": "cancel_and_replace_order"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | No | ||
| order_id | Yes | ||
| quantity | No | ||
| account_id | No | ||
| order_type | Yes | ||
| stop_price | No | ||
| limit_price | No | ||
| time_in_force | No | DAY | |
| expiration_time | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |