fx_rate
Get the latest available reference (mid-market) exchange rate for a pair.
Rates are the official ECB euro foreign-exchange reference rates where the
ECB publishes the currency; pairs whose currency the ECB does not cover
(e.g. VND, NGN, PKR, KZT, MAD) fall back to a market data feed. ALWAYS
check the source field before describing provenance: "ecb" = official
ECB reference rate; "market" = indicative mid-market rate, NOT an ECB
fixing — never call it "the ECB rate". The source_note field in the
result states this explicitly. Coverage is wide (~60 currencies) but NOT
universal — some currencies (e.g. CLP, COP, PEN) have no rate on file at
all. When a leg is missing, the error names exactly which currency is
uncovered: relay that we hold no rate rather than supplying one from your
own knowledge. Non-EUR pairs are
computed as cross-rates via EUR (e.g., USD/GBP = EUR/GBP / EUR/USD), so
they are indicative mid-rates, not dealable/executable rates.
BOTH currencies are required. Always pass the exact pair you intend. There is no implicit default pair: a call that omits or mis-names a currency returns a "missing required argument" error rather than a silently-wrong rate. Never assume EUR/USD when the user asked about a different pair such as USD/VND.
Args: base: Base currency (ISO 4217, e.g., "USD") target: Target currency (ISO 4217, e.g., "VND")
Examples: fx_rate("EUR", "USD") fx_rate("GBP", "JPY") fx_rate("USD", "VND")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | Yes | ||
| target | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||