Check FX Mid-Market Rate
check_fx_mid_market_rateReturns the live mid-market FX rate for a currency pair (Twelve Data, Open Exchange Rates fallback), in both directions (pair and inverted_pair). Inputs: currency_from, currency_to, optional bank_rate. When bank_rate is given, the output also includes the spread versus mid-market; both quote directions (rate and 1/rate) are tested, the closer one is kept and flagged as inverted when 1/rate wins; a rate more than 10% from mid-market in both directions is rejected as incoherent.
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": {
"currency_from": "<currency_from>",
"currency_to": "<currency_to>"
},
"name": "check_fx_mid_market_rate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bank_rate | No | Optional bank/broker rate. When provided, returns spread vs mid-market and tests both quote directions; >10% off in both → rejected as incoherent. | |
| currency_to | Yes | ISO 4217 quote currency (e.g. CAD) | |
| currency_from | Yes | ISO 4217 base currency (e.g. USD) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| low | No | ||
| high | No | ||
| note | No | ||
| pair | Yes | ||
| bank_rate | No | ||
| fetched_at | Yes | ||
| spread_bps | No | ||
| spread_pct | No | ||
| currency_to | Yes | ||
| currency_from | Yes | ||
| inverted_pair | No | ||
| rate_provider | Yes | ||
| bank_rate_input | No | ||
| mid_market_rate | Yes | ||
| rate_from_cache | No | ||
| cotation_inversee | No | ||
| inverted_mid_rate | No | ||
| mcp_server_version | No | ||
| rate_timestamp_utc | Yes | ||
| loss_per_million_usd | No | ||
| inverted_rate_applied | No |