Prepare position close
perps_prepare_position_closePreviews closing the open position on one contract. Read-only safety gate: runs risk checks and returns a short-lived confirmation token (~90s). Present the summary, get explicit user confirmation, then call perps_execute_operation with the token. Makes no changes itself. Executing returns the closing order's id, not a position object.
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": {
"contractId": "<contractId>"
},
"name": "perps_prepare_position_close"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contractId | Yes | Numeric contract id from perps_list_contracts with an open position. 0 is a real contract id, not a placeholder for "unset". |