MCP cookbook

CurrencyCore MCP cookbook.
Nine examples, realistic responses.

Each card shows the question, the tool the agent calls, the request arguments, and a realistic JSON response. Use these as reference patterns for Claude, Cursor, or any MCP client.

Reference calls

What the agent sends and gets back.

Values are illustrative so you can see the shape of each response. Current numbers come from the latest central-bank reference rate, and each response reports the date used.

convert Core

What is 500 USD in INR today?

Use this when the answer is one number and the user supplied an amount. It is the shortest path for checkout totals, invoices, and price labels.

Request arguments
{
  "from": "USD",
  "to": "INR",
  "amount": 500
}
JSON response
{
  "from": "USD",
  "amount": 500,
  "date": "2026-06-22",
  "results": [
    { "to": "INR", "result": 41710, "rate": 83.42 }
  ]
}

Use this for checkout totals, invoices, and any single conversion. Omit amount to get the raw pair rate.

CoreAll plans
get_rates Core

What are today's rates against the dollar?

Use this when the app needs a whole rate table, such as a currency picker or a dashboard. One call returns every supported currency for the date, and the cache can be shared across users.

Request arguments
{
  "date": "2026-06-22"
}
JSON response
{
  "base": "USD",
  "date": "2026-06-22",
  "rates": {
    "EUR": 0.914,
    "GBP": 0.786,
    "JPY": 154.2,
    "INR": 83.42,
    "CHF": 0.892
  }
}

Returns the full snapshot for a date. Use get_rates_by_base when the table should be expressed in a non-USD base.

CoreAll plans
get_history Core

How has USD/INR moved over the last week?

Use this when the question is about a range rather than a moment: a chart, a backtest, or the rate on each invoice date. Pass interval when daily points would be too many.

Request arguments
{
  "currency": "INR",
  "base": "USD",
  "from": "2026-06-15",
  "to": "2026-06-22"
}
JSON response
{
  "currency": "INR",
  "base": "USD",
  "interval": "daily",
  "from": "2026-06-15",
  "to": "2026-06-22",
  "rates": {
    "2026-06-15": 83.30,
    "2026-06-16": 83.42,
    "2026-06-17": 83.38,
    "2026-06-18": 83.45,
    "2026-06-19": 83.51,
    "2026-06-20": 83.51,
    "2026-06-21": 83.51,
    "2026-06-22": 83.42
  }
}

Daily is the default. Pass interval weekly, monthly, or yearly for charts and longer ranges. Free plans can request the last 30 days.

CoreAll plans
analyze_ppp Analytics

Has India's PPP factor changed over the last decade?

Use this when a price needs to reflect local purchasing power, not just the market rate. The analysis form is for trend questions; use convert with ppp=true for a single localized price.

Request arguments
{
  "countries": "IND",
  "period": "10y"
}
JSON response
{
  "from": 2016,
  "to": 2026,
  "mode": "compare",
  "results": [
    {
      "country": "IND",
      "startYear": 2016,
      "endYear": 2025,
      "startFactor": 17.8,
      "endFactor": 23.1,
      "changePct": 29.8,
      "stats": { "min": 17.8, "max": 23.1, "avg": 20.4 }
    }
  ]
}

The factor is local currency units per international dollar. A rising factor means India's price level rose relative to the international dollar. Growth+ required.

AnalyticsGrowth+
analyze_volatility Analytics

Which of these currencies moved the most against the dollar last year?

Use this to rank or compare risk over a window. It answers which currency moved the most with annualized volatility, not a single day's change.

Request arguments
{
  "currency": "TRY,ARS,INR,EUR",
  "base": "USD",
  "from": "2025-06-22",
  "to": "2026-06-22"
}
JSON response
{
  "base": "USD",
  "from": "2025-06-22",
  "to": "2026-06-22",
  "mode": "compare",
  "basis": "annualized-daily",
  "results": [
    { "currency": "ARS", "volatility": 48.2, "observations": 365 },
    { "currency": "TRY", "volatility": 31.6, "observations": 365 },
    { "currency": "INR", "volatility": 4.8, "observations": 365 },
    { "currency": "EUR", "volatility": 6.4, "observations": 365 }
  ]
}

Annualized volatility in percent. Lower is more stable. Omit currency to rank the liquid set instead. Growth+ required.

AnalyticsGrowth+
analyze_drawdown Analytics

How bad was the euro's worst fall against the dollar in the last decade?

Use this when the risk question is about the worst case, not the average. It returns the peak, trough, and recovery dates so the agent can explain when the decline happened and whether it recovered.

Request arguments
{
  "currency": "EUR",
  "base": "USD",
  "from": "2016-06-17",
  "to": "2026-06-17"
}
JSON response
{
  "base": "USD",
  "from": "2016-06-17",
  "to": "2026-06-17",
  "mode": "compare",
  "results": [
    {
      "currency": "EUR",
      "maxDrawdownPct": -18.4,
      "peakDate": "2018-02-15",
      "troughDate": "2022-09-27",
      "recoveryDate": null,
      "recoveryDays": null
    }
  ]
}

maxDrawdownPct is signed. A null recovery means the currency had not returned to its prior peak by the end date, not that the risk was zero. Growth+ required.

AnalyticsGrowth+
analyze_safe_haven Analytics

Which currencies held up best in a crisis?

Use this for a ranked, auditable safety comparison. The score combines low volatility, shallow drawdown, and behavior during the 2008 crisis, and each component is returned separately.

Request arguments
{
  "base": "USD",
  "limit": 5
}
JSON response
{
  "base": "USD",
  "from": "2007-01-01",
  "to": "2026-06-17",
  "crisis": {
    "label": "the 2008 global financial crisis",
    "from": "2007-12-01",
    "to": "2009-06-30"
  },
  "results": [
    { "currency": "CHF", "score": 82.4, "volatility": 6.1, "maxDrawdownPct": -14.2, "crisisReturnPct": 8.7 },
    { "currency": "JPY", "score": 71.2, "volatility": 8.4, "maxDrawdownPct": -18.5, "crisisReturnPct": 12.3 }
  ]
}

Scores run from 0 to 100, higher is safer. The default window starts in 2007 so the 2008 crisis is included. Growth+ required.

AnalyticsGrowth+
analyze_mean_reversion Analytics

Which currencies tend to return to their average?

Use this when a trading or treasury question is about oscillation rather than trend. It reports a score, the current deviation from the mean, crossing frequency, and an estimated half-life.

Request arguments
{
  "base": "USD",
  "limit": 5
}
JSON response
{
  "base": "USD",
  "from": "2024-06-17",
  "to": "2026-06-17",
  "results": [
    { "currency": "EUR", "score": 71.5, "deviationPct": -1.2, "reversionFrequency": 0.32, "halfLifeDays": 18.4 },
    { "currency": "GBP", "score": 64.0, "deviationPct": 0.8, "reversionFrequency": 0.27, "halfLifeDays": 24.1 }
  ]
}

A higher score means the currency crossed its mean more often and reverted faster. A negative deviationPct means it is below its average. Growth+ required.

AnalyticsGrowth+
GET /v1/ai REST

Convert 50 euro to Indian rupees and explain the rate.

Use this when you want one natural-language answer with the supporting data, without writing your own tool loop. It is a REST endpoint, not an MCP tool, so it fits a backend job or a chat feature.

Request arguments
GET /v1/ai?q=Convert+50+euro+to+indian+rupees
JSON response
{
  "query": "Convert 50 euro to indian rupees",
  "answer": "50 EUR = 4,549.00 INR at the latest reference rate.",
  "data": [
    {
      "from": "EUR",
      "to": "INR",
      "amount": 50,
      "result": 4549.00,
      "rate": 90.98,
      "pppApplied": false,
      "asOf": "2026-06-22"
    }
  ],
  "toolCalls": 1
}

This is the REST AI endpoint, not an MCP tool name. Use it when you want one natural-language answer without orchestrating tools yourself. AI calls use AI credits, not API requests.

AIREST
Choose a tool

Start with the shape of the answer.

If the user wants one number, call convert. If they want a table for a date, call get_rates or get_rates_by_base. If they want a line chart or a backtest, call get_history. If they want a summary rather than raw points, call an analyze_ tool and let the server do the statistics.

For risk questions, pick the statistic that matches the question. analyze_volatility measures dispersion, analyze_drawdown measures the worst peak-to-trough fall, analyze_safe_haven combines stability and crisis behavior, and analyze_mean_reversion measures oscillation around an average. For purchasing power, use convert with ppp=true for a price and analyze_ppp for a factor trend.

Plan gates are part of the choice. Core and reference tools work on Free, while the analytics tools require Growth or higher. A well-behaved agent should read the 403, explain the entitlement, and offer the core alternative instead of retrying the same call.

Error handling

What a 429 looks like.

Rate limits, bad dates, and plan gates return a structured error body. The agent should read the code, honor any retry delay, and explain the fix instead of retrying blindly. A 429 is temporary and retryable; a 403 usually means the plan does not include the tool; a 400 means the request needs a different parameter.

429 rate_limited Retry-After: 12
Illustrative response body
{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded. Retry after 12 seconds.",
    "details": {}
  }
}
What the agent should do
  • Wait for the Retry-After value, then retry once.
  • Do not retry a 400, 401, 403, or 404 unchanged.
  • Surface the message and the status code so a developer can see what went wrong.

The same envelope covers validation and plan errors. Full code list: error reference.

Compose multiple tools

One question, two calls.

Agents do not need a custom endpoint for every question. They can call two tools and combine the results. This is also the pattern for compound questions: fetch the statistic, fetch the conversion, then explain both in one answer.

Question

"Is EUR correlated with GBP, and what would 10,000 EUR be in GBP?"

Call 1 analyze_correlation { base: "EUR", currencies: "GBP", from: "2023-06-22", to: "2026-06-22" }
{
  "base": "EUR",
  "from": "2023-06-22",
  "to": "2026-06-22",
  "results": [
    { "currency": "GBP", "correlation": 0.94, "observations": 1096 }
  ]
}
Call 2 convert { from: "EUR", to: "GBP", amount: 10000 }
{
  "from": "EUR",
  "amount": 10000,
  "date": "2026-06-22",
  "results": [
    { "to": "GBP", "result": 8598, "rate": 0.8598 }
  ]
}
Combined answer

EUR and GBP have a 0.94 correlation over the past three years, which means they have moved closely together. At today's rate, 10,000 EUR is about 8,598 GBP.

The MCP client orchestrates the calls. It decides which tools to use, runs them, and writes the final answer. The same pattern works with Claude and Cursor.

Also available

More tools in the same server.

These calls follow the same shape. Use get_ppp_factor when you need the raw multiplier, and the list tools before generating config so the agent does not invent a code. Full parameter schemas are in the MCP tool reference.

Tool Question it answers Plan
get_rates_by_baseWhat does the rate table look like against EUR, INR, or another base?All plans
get_ppp_factorWhat is one country's IMF PPP factor for a year?All plans
analyze_historyHow did a currency trend over a chosen window?Growth+
analyze_drawdownHow deep was the decline, and how fast did it recover?Growth+
analyze_safe_havenWhich currency behaves most like a safe haven?Growth+
analyze_mean_reversionHow strongly does a currency return to its average?Growth+
list_countriesWhat is the official currency code for this country?All plans
list_currenciesWhich ISO 4217 currencies are supported?All plans

The same data is available over HTTP from the currency API. MCP access is included on every plan, including Free. See pricing for request limits and analytics entitlements. Related: MCP documentation, OAuth and access, troubleshooting, and MCP vs REST.

Connect your agent.
14 tools. Every currency question.

Free tier: 1,000 requests per month. MCP included. No credit card required.

Connect your agent Explore the MCP server