Margin or profit
calculateThe margin an order would need, or its profit between two prices, as the broker computes it; opens nothing. The account must be online. Example: {"account_id": "", "kind": "margin", "symbol": "EURUSD", "side": "buy", "volume": "0.10", "price": "1.08450"}
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": {
"account_id": "<account_id>",
"kind": "<kind>",
"symbol": "<symbol>",
"side": "<side>",
"volume": "<volume>",
"price": "<price>"
},
"name": "calculate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | margin: required to open. profit: result between price and close_price. | |
| side | Yes | buy or sell. | |
| price | Yes | Entry price. An absolute price (e.g. "1.08450"), not a distance in pips or points. | |
| symbol | Yes | The symbol exactly as this broker names it, e.g. "EURUSD" — some brokers add a suffix such as "EURUSD.r". | |
| volume | Yes | Order size. In lots, preferably as a string: "0.01" is a micro lot, "1.00" a standard lot. | |
| account_id | Yes | The fxapis account id (a UUID) from list_accounts — not the MT5 login number. | |
| close_price | No | Exit price. Required when kind is profit. An absolute price (e.g. "1.08450"), not a distance in pips or points. | |
| response_format | No | concise (default): what a next step needs. detailed: every field the API returns. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | ||
| value | Yes | In the account's currency. |