Forex PnL
workflow.run_forex_pnlProfit or loss for a closed or hypothetical forex trade, in pips and in the pair's own quote currency, long or short. Precious-metal pairs (XAU, XAG, XPT, XPD) are refused with an error, because their pip and lot size differ by broker. Edge cases: entryPrice, exitPrice and units above zero; The pair is BASE/QUOTE with two different ISO 4217 currency codes, in any letter case; crypto tickers and precious metals (XAU, XAG, XPT, XPD) are refused. A pip is 0.01 for a pair quoted in JPY and 0.0001 for every other pair, and a standard lot is 100,000 units. The result is in the quote currency; a short position gains when the price falls. Not covered: spread, commission, swap, slippage and account-currency conversion. Use when user asks "what did I make/lose on this trade?" or "what would X pips be worth on Y lots?". Returns: pips (signed, positive favors the position taken), pnlQuote.
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": {
"pair": "<pair>",
"side": "<side>",
"entryPrice": "<entryPrice>",
"exitPrice": "<exitPrice>",
"units": "<units>"
},
"name": "workflow.run_forex_pnl"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pair | Yes | Currency pair in BASE/QUOTE format, e.g. "EUR/USD" | |
| side | Yes | Trade direction: "long" or "short" | |
| units | Yes | Position size in base-currency units | |
| exitPrice | Yes | Exit price, same quote convention as the entry price | |
| entryPrice | Yes | Entry price in the pair's own quote terms, e.g. 1.0850 for EUR/USD |