MCP
MCP Tools
Reference for all 14 CurrencyCore MCP tools, with inputs, plan requirements, response fields, and error behavior.
The CurrencyCore MCP server exposes 14 tools. Each one wraps one public REST endpoint, so the response fields match the REST reference exactly. This page lists the purpose, inputs, plan requirement, a call example, the response shape, and the errors for every tool.
- Reference tools:
list_countries,list_currencies - Core currency tools:
convert,get_rates,get_rates_by_base,get_history,get_ppp_factor - Analytics tools:
analyze_history,analyze_ppp,analyze_volatility,analyze_correlation,analyze_drawdown,analyze_safe_haven,analyze_mean_reversion
All tools are read-only. Amounts and rates are numbers; dates are UTC
YYYY-MM-DD strings.
How tool calls behave
Arguments
Tool arguments are the same parameters as the REST endpoint, without the URL. Optional parameters can be omitted. Numbers may arrive as strings over JSON-RPC, so the server coerces numeric arguments. Booleans are real booleans.
Missing required path parameters, such as base for get_rates_by_base, return
a tool error before any API call is made.
Successful calls
A successful call returns the API’s JSON body as text. When the body is a JSON
object, the server also returns it as structuredContent, which clients that
support structured tool output can consume directly.
Every result includes _meta fields for usage reconciliation:
| Field | Meaning |
|---|---|
currencycore/tool_calls | 1 when the call succeeded, 0 otherwise. |
currencycore/billed_requests | 1 for a successful keyed call, 0 for a public call or an error. |
currencycore/retryable | Whether retrying the same call could plausibly succeed. |
currencycore/status | The HTTP status returned by the REST API. |
currencycore/retry_after_s | Seconds to wait, present on a 429 with Retry-After. |
currencycore/reauth | Present when an authorized call was rejected with 401 or 403. |
A successful keyed tool call counts as one API request. Public tool calls and failed calls are not billed.
Errors
The REST API uses one error envelope:
{
"error": {
"code": "unknown_currency",
"message": "Unknown currency: XYZ",
"details": {}
}
}
The MCP server returns that body as the tool text with isError: true. It does
not convert an API error into a JSON-RPC transport error, so the model can read
the code and decide what to do next.
| Status | Code | What it means over MCP |
|---|---|---|
400 | invalid_input | A parameter is malformed, missing, or out of range. |
400 | unknown_currency | The currency code is not supported. Use list_currencies. |
400 | unknown_ppp | The country or year has no PPP factor. |
401 | unauthorized | The connection is missing, expired, or revoked. Reconnect and sign in again. |
402 | billing_past_due | The organization’s billing is past due. An owner or admin must clear payment. |
403 | forbidden | The plan does not include the tool, the organization has MCP disabled, or the requested history window is outside the plan. |
404 | rate_not_found or unknown_currency | No rate snapshot or history exists for the requested date, base, or currency. |
429 | rate_limited | The organization hit its per-minute limit or monthly quota. Read currencycore/retry_after_s. |
5xx | internal_error | The API failed. The call is retryable and is not billed. |
A 403 is not always an expired connection. Read the message: an analytics plan
gate and a disabled MCP toggle both return 403 for different reasons. A removed
membership usually surfaces as 401, because the grant no longer resolves to an
organization. The troubleshooting guide maps each
one to a fix.
Some server versions replace the API body with a reconnect message when a keyed
call returns 401 or 403. If the text says the connection expired but you
expected a plan gate, check structuredContent.error.code or the
currencycore/status metadata. A 403 with forbidden is a plan, history
window, or MCP-toggle problem, not an expired token.
Retries
The MCP server retries transient failures (network errors, timeouts, 429, and
5xx) up to two attempts with a short jittered backoff. A 4xx client error is
returned immediately. Retry-After is capped at 5 seconds for the MCP retry, so
a longer server-side window still surfaces as a 429 to the client.
Reference tools
list_countries
Returns every supported country and its official currency. Use it to resolve a country name to the alpha-3 code that PPP calls need.
- Plan: every plan, after an authorized MCP connection.
- Inputs: none.
- Call:
{} - Returns: an array of objects with
code(ISO/IMF alpha-3),name, andcurrencies(an array of ISO 4217 codes). - Errors: none expected after connection. The underlying REST endpoint is public, but the MCP server requires OAuth.
list_currencies
Returns every supported ISO 4217 currency, plus the documented non-ISO codes. Use it before a conversion so an unsupported code fails clearly instead of silently.
- Plan: every plan, after an authorized MCP connection.
- Inputs: none.
- Call:
{} - Returns: an array of objects with
code,numeric,name, andsymbol.numericis the zero-padded ISO numeric code, or an empty string for CNH, GGP, IMP, and JEP. The list can include codes beyond the fiat rate feed, such as XAU, XAG, XPT, XPD, and XDR. The rate feed is fiat only, so check withconvertbefore relying on a metal or a synthetic unit. - Errors: none expected after connection. The underlying REST endpoint is public, but the MCP server requires OAuth.
Core currency tools
convert
Converts an amount between currencies, optionally with a purchasing-power-parity adjustment. This is the tool most agent conversations use.
- Plan: every plan.
- Inputs:
| Input | Type | Required | Notes |
|---|---|---|---|
from | string | Yes | Source currency, for example USD. With ppp=true, use CUR:COUNTRY, for example USD:USA. |
to | string | Yes | One or more targets, comma-separated, maximum 25. With ppp=true, pass CUR:COUNTRY for currencies used in more than one country; common currencies resolve automatically. |
amount | number | No | Defaults to 1, so each result equals the rate. Must be positive. |
ppp | boolean | No | Applies the PPP adjustment. Pass CUR:COUNTRY for ambiguous currencies; common currencies resolve automatically. |
date | string | No | UTC date. Defaults to the latest. Future dates are rejected. On Free, only the last 30 days are allowed. |
- Call:
{ "from": "USD", "to": "EUR,INR", "amount": 100 }
- Returns:
from,amount,date, andresults. Each result hasto,result(the plain FX conversion),rate(result divided by amount), and, when PPP was requested,fromCountry,toCountry, and apppobject.results[].pppcontainsfromFactor,toFactor, andresult, or anerrorstring when PPP could not be applied for that target. - Errors:
invalid_inputfor a bad amount or date, andunknown_currency. A missing PPP factor is not a request error: that target returnsppp.errorin a200response. An out-of-window history date on Free returns403, and a rate limit returns429. - REST reference: /convert
get_rates
Returns the full exchange-rate snapshot for a date, with USD as the base.
- Plan: every plan.
- Inputs:
| Input | Type | Required | Notes |
|---|---|---|---|
date | string | No | UTC date. Defaults to the latest available date. |
- Call:
{ "date": "2026-11-10" }
- Returns:
base(USD),date, andrates, a map of currency code to units per 1 USD. - Errors:
404 rate_not_foundwhen no snapshot exists for that date,403for an out-of-window history date on Free,429. - REST reference: /rates
get_rates_by_base
Returns the same snapshot re-expressed against a base currency other than USD.
- Plan: every plan.
- Inputs:
| Input | Type | Required | Notes |
|---|---|---|---|
base | string | Yes | Base currency, for example EUR. |
date | string | No | UTC date. Defaults to the latest available date. |
- Call:
{ "base": "EUR" }
- Returns:
base,date, andrates. The base itself is1in the map. - Errors: a missing
baseis rejected by the MCP server before the API call. An unknown base returns400 unknown_currency; a missing snapshot returns404 rate_not_found. An out-of-window date on Free returns403, and a rate limit returns429. - REST reference:
/rates/{base}
get_history
Returns a daily (or aggregated) rate series for one currency over a date range.
- Plan: every plan. Free is limited to the last 30 days; Starter and above get full history.
- Inputs:
| Input | Type | Required | Notes |
|---|---|---|---|
currency | string | Yes | One currency per call, for example INR. |
from | string | No | UTC start date. Defaults to 7 days before to. |
to | string | No | UTC end date. Defaults to today; a future date clamps to today. |
base | string | No | Base currency. Defaults to USD. |
interval | string | No | daily (default), weekly, monthly, or yearly. Coarser intervals average the daily rates per bucket. |
- Call:
{ "currency": "INR", "base": "USD", "from": "2026-01-01", "to": "2026-11-10", "interval": "monthly" }
- Returns:
currency,base,interval,from,to, andrates.ratesis a map of bucket to rate. Daily keys are dates; weekly keys are the week’s Monday; monthly keys areYYYY-MM; yearly keys areYYYY. - Errors:
403when the range reaches past the Free 30-day window,404 unknown_currencywhen no history exists for the currency,429. - REST reference: /history
get_ppp_factor
Returns one country’s IMF World Economic Outlook PPP conversion factor for a year.
- Plan: every plan, with an authorized connection.
- Inputs:
| Input | Type | Required | Notes |
|---|---|---|---|
country | string | Yes | ISO 3166-1 alpha-3 code, for example IND. |
year | number | No | Four-digit year. Defaults to the configured PPP year, 2024. |
- Call:
{ "country": "IND", "year": 2024 }
- Returns:
year,countryCode,pppFactor(local currency units per international dollar), andprojected(true when the value is an IMF projection rather than actual data). - Errors:
unknown_pppor404when no factor exists for that country and year,429. - REST reference: the PPP factor is the keyed
/v1/ppphelper. For a consumer conversion with PPP applied, useconvertwithppp=true. For multi-year analysis, see PPP analysis.
Analytics tools
These seven tools require Growth or higher. On Free and Starter, the API
returns 403 forbidden at call time. The tools stay visible in the client, so an
agent can still explain that the organization needs an upgrade.
All seven accept an optional base, default to USD, and return a results
array. The window defaults are listed per tool. Dates are UTC.
analyze_history
Summarizes change, strength, and min/max/avg over a window, and can rank every currency as a “movers” list.
- Plan: Growth or higher.
- Inputs:
| Input | Type | Required | Notes |
|---|---|---|---|
base | string | No | Currency everything is measured against. Defaults to USD. |
currencies | string | No | Comma-separated currencies to compare. Omit to rank all currencies. |
from | string | No | UTC start. Defaults to 20 years before to. |
to | string | No | UTC end. Defaults to today; a future date clamps to today. |
period | string | No | Shorthand for from: 10y, 6m, 30d, ytd, or max. Ignored when from is set. |
sort | string | No | In movers mode: strengthened (default) or weakened. |
assetClass | string | No | Movers universe: fiat (default), metals, or all. |
limit | number | No | Movers count. Default 10, maximum 200. |
interval | string | No | Adds a trend series per named currency: weekly, monthly, or yearly. Compare mode only. |
stats | boolean | No | Includes min/max/avg. Defaults to true. |
- Call:
{ "currencies": "EUR,GBP", "base": "USD", "period": "5y", "interval": "yearly" }
- Returns:
base,from,to,mode(compareormovers),sort,assetClass,stats, andresults. Each result hascurrency,startRate,endRate,changePct,strengthenedPct,stats(min,max,avg), andseries(period to average rate, whenintervalis set). - Errors:
403on Free or Starter,404when no data exists at or before the requested start or end date,429. - REST reference: /history/analysis
analyze_ppp
Shows how PPP factors changed over time for named countries, or ranks countries by PPP-factor change.
- Plan: Growth or higher.
- Inputs:
| Input | Type | Required | Notes |
|---|---|---|---|
countries | string | No | Comma-separated alpha-3 codes. Omit to rank all countries. |
from | string | No | Start year as a string, for example "2015". Defaults to 10 years before to. |
to | string | No | End year as a string. Defaults to the current year. |
period | string | No | Shorthand for from: 10y, 20y, or max. Ignored when from is set. |
sort | string | No | In movers mode: increased (default) or decreased. |
limit | number | No | Movers count. Default 10, maximum 200. |
stats | boolean | No | Includes min/max/avg of the factor. Defaults to true. |
- Call:
{ "countries": "IND,DEU,USA", "period": "10y" }
- Returns:
from,to,mode,sort,stats, andresults. Each result hascountry,startYear,endYear,startFactor,endFactor,changePct,projected,stats, andseries(year to factor, in compare mode). - Errors:
403on Free or Starter,429. - REST reference: /ppp/analysis
analyze_volatility
Measures annualized volatility for named currencies, or ranks the liquid set by stability.
- Plan: Growth or higher.
- Inputs:
| Input | Type | Required | Notes |
|---|---|---|---|
currency | string | No | One currency or a comma-separated list. Omit to rank the universe. |
base | string | No | Base to measure against. Defaults to USD. |
from | string | No | UTC start. Defaults to 365 days before to. |
to | string | No | UTC end. Defaults to today; a future date clamps to today. |
sort | string | No | In ranking mode: stable (default) or volatile. |
universe | string | No | liquid (default) or majors (USD, EUR, GBP, JPY, CHF, CAD, AUD, NZD). |
limit | number | No | Ranking count. Default 10, maximum 50. |
- Call:
{ "currency": "INR,BRL", "base": "USD", "from": "2024-11-10", "to": "2026-11-10" }
- Returns:
base,from,to,mode(compareorranking),sort,basis(annualized-daily), andresults. Each result hascurrency,volatility(annualized percent, or null when there is too little data), andobservations. - Errors:
403on Free or Starter,429. - REST reference: /volatility
analyze_correlation
Measures how closely each named currency’s daily returns move with a base currency.
- Plan: Growth or higher.
- Inputs:
| Input | Type | Required | Notes |
|---|---|---|---|
base | string | No | Reference currency. Defaults to USD, but a non-USD base is usually more meaningful. |
currencies | string | Yes | Comma-separated currencies to correlate with base. |
from | string | No | UTC start. Defaults to 365 days before to. |
to | string | No | UTC end. Defaults to today. |
- Call:
{ "base": "EUR", "currencies": "GBP,CHF,SEK", "from": "2025-11-10" }
- Returns:
base,from,to, andresults. Each result hascurrency,correlation(Pearson correlation of daily returns, from -1 to 1, or null if undefined), andobservations. - Errors:
invalid_inputwhencurrenciesis missing,403on Free or Starter,429. - REST reference: /correlation
analyze_drawdown
Finds the maximum peak-to-trough decline for named currencies, or ranks the set by drawdown depth or recovery speed.
- Plan: Growth or higher.
- Inputs:
| Input | Type | Required | Notes |
|---|---|---|---|
currency | string | No | One currency or a comma-separated list. Omit to rank the universe. |
base | string | No | Base to measure against. Defaults to USD. |
from | string | No | UTC start. Defaults to 365 days before to. |
to | string | No | UTC end. Defaults to today. |
sort | string | No | In ranking mode: deepest (default) or recovery. |
universe | string | No | liquid (default) or majors. |
limit | number | No | Ranking count. Default 10, maximum 50. |
- Call:
{ "currency": "GBP", "base": "USD", "from": "2008-01-01", "to": "2012-12-31" }
- Returns:
base,from,to,mode(compareorranking), andresults. Each result hascurrency,maxDrawdownPct(signed percent),peakDate,troughDate,recoveryDate(or null if not recovered byto), andrecoveryDays(or null). - Errors:
403on Free or Starter,429. - REST reference: /drawdown
analyze_safe_haven
Ranks currencies by a composite safe-haven score built from volatility, drawdown, and crisis performance.
- Plan: Growth or higher.
- Inputs:
| Input | Type | Required | Notes |
|---|---|---|---|
currencies | string | No | Comma-separated currencies to score. Omit to rank the liquid-fiat pool. Precious metals are not supported. |
base | string | No | Base to measure against. Defaults to USD. |
from | string | No | UTC start. Defaults to 2007-01-01, or 20 years before to when that is later. |
to | string | No | UTC end. Defaults to today. |
limit | number | No | Count. Default 10, maximum 50. |
- Call:
{ "currencies": "CHF,JPY", "base": "USD" }
- Returns:
base,from,to,crisis(label,from,to), andresults. Each result hascurrency,score(0 to 100, higher is safer, or null),volatility,maxDrawdownPct, andcrisisReturnPct(appreciation during the reference crisis). - Errors:
403on Free or Starter,429. - REST reference: /safe-haven
analyze_mean_reversion
Ranks currencies by how strongly they revert to their mean, using crossing frequency and reversion half-life.
- Plan: Growth or higher.
- Inputs:
| Input | Type | Required | Notes |
|---|---|---|---|
currencies | string | No | Comma-separated currencies to score. Omit to rank the liquid set. |
base | string | No | Base to measure against. Defaults to USD. |
from | string | No | UTC start. Defaults to about 2 years before to. |
to | string | No | UTC end. Defaults to today. |
limit | number | No | Count. Default 10, maximum 50. |
- Call:
{ "currencies": "EUR,GBP", "base": "USD" }
- Returns:
base,from,to, andresults. Each result hascurrency,score(0 to 100, higher is more mean-reverting, or null),deviationPct(current deviation from the window mean),reversionFrequency(mean crossings per observation, 0 to 1), andhalfLifeDays(null when non-reverting). - Errors:
403on Free or Starter,429. - REST reference: /mean-reversion