Trade Calculation
trade.calculateDeterministic trade arithmetic over numbers you supply: landed cost, trade margin, break-even price, or the effect of a USD move. Nothing is sourced — there is no free source for duty rates, freight or insurance, so an input you omit is excluded from the total and reported in missing, never defaulted to zero. Use price.latest first if you want a benchmark price to pass as unit_price.
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": {
"calculation": "<calculation>"
},
"name": "trade.calculate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | No | fx_impact: amount held in the foreign currency. | |
| fx_rate | No | landed_cost: units of quote_currency per USD. fx_impact: the rate to shock. | |
| incoterm | No | landed_cost: decides which costs your price already carries, so it shapes `missing`. CIF already includes freight and insurance. Example: CIF. | |
| port_usd | No | landed_cost: port charges. | |
| quantity | No | Quantity. Example: 100. | |
| buy_price | No | trade_margin, break_even: purchase price per unit. | |
| costs_usd | No | trade_margin, break_even: other costs. | |
| rate_unit | No | fx_impact: direction of fx_rate, read not inferred. Example: GHS/USD means cedi per dollar. | |
| price_unit | No | landed_cost: unit of unit_price. Example: USD/metric ton. | |
| sell_price | No | trade_margin: sale price per unit. | |
| unit_price | No | landed_cost: price per unit. Example: 1133.13. | |
| calculation | Yes | Which calculation to run. Example: landed_cost. | |
| freight_usd | No | landed_cost: your freight cost. Omit and it is reported missing, not assumed zero. | |
| handling_usd | No | landed_cost: handling charges. | |
| usd_move_pct | No | fx_impact: percent the USD strengthens. Example: 5. | |
| duty_rate_pct | No | landed_cost: your import duty rate, percent. Example: 8. | |
| insurance_usd | No | landed_cost: your insurance cost. | |
| quantity_unit | No | landed_cost: unit of quantity. Example: metric ton. | |
| quote_currency | No | landed_cost: currency for the total. Needs fx_rate — no rate is sourced. Example: GHS. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unit | Yes | Unit of the result | |
| notes | No | Caveats, including unmodelled distinctions | |
| value | Yes | The result | |
| formula | No | How it was computed | |
| missing | Yes | Inputs not supplied. Their components are excluded from the total, not defaulted. | |
| partial | Yes | True when anything is missing | |
| components | Yes | Each part of the build-up, with where its number came from | |
| disclaimer | No | ||
| assumptions | No | Caller-supplied inputs, echoed | |
| calculation | Yes | Which calculation ran |