GnistAI GnistAI
Log in

Getting Started with Currency Conversion

Real-time and historical currency conversion — 30+ currencies with ECB reference rates.

All Tutorials   |   Overview   |   Playground   |   MCP   |   REST API   |   Home
Finance

Data source: Frankfurter API (ECB)

Overview

Currency Conversion wraps Frankfurter API (ECB), handling authentication, pagination, and rate limits for you. This tutorial covers all 4 tools with working code examples you can copy and run.

Prerequisites

  1. Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
  2. Choose your integration method: MCP protocol or REST API.

Connect via MCP

Add to your MCP client config (Claude Desktop, Cursor, etc.):

MCP Config
{
  "mcpServers": {
    "gnist-currency-conversion": {
      "url": "https://context.gnist.ai/mcp/currency-conversion/",
      "headers": {
        "Gnist-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Tools (4)

convert_currency

Convert an amount from one currency to another using real-time or historical rates. Supports 30+ currencies including USD, EUR, GBP, NOK, SEK, JPY, and more. Uses European Central Bank reference rates via Frankfurter API. Args: amount: The amount to convert (must be positive). base: Source currency code (e.g. "USD", "EUR", "NOK"). target: Target currency code (e.g. "GBP", "SEK", "JPY"). date: Optional ISO date (YYYY-MM-DD) for historical rate. Omit for latest.

ParameterTypeRequiredDescription
amountnumberrequired
basestringrequired
targetstringrequired
dateanyoptional
curl -X POST "https://context.gnist.ai/mcp/currency-conversion/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "convert_currency", "arguments": {"amount": 1.0, "base": "example", "target": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/currency-conversion/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'amount': 1.0,
                          'base': 'example',
                          'target': 'example'},
            'name': 'convert_currency'}},
)
print(resp.json())

get_exchange_rates

Get all exchange rates for a base currency. Returns rates for 30+ currencies relative to the specified base. Args: base: Base currency code (default: "EUR"). date: Optional ISO date (YYYY-MM-DD) for historical rates. Omit for latest.

ParameterTypeRequiredDescription
basestringoptional (default: EUR)
dateanyoptional
curl -X POST "https://context.gnist.ai/mcp/currency-conversion/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_exchange_rates", "arguments": {"base": "EUR"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/currency-conversion/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'base': 'EUR'}, 'name': 'get_exchange_rates'}},
)
print(resp.json())

list_currencies

List all supported currency codes for conversion. Returns ISO 4217 currency codes supported by the exchange rate service.

curl -X POST "https://context.gnist.ai/mcp/currency-conversion/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "list_currencies", "arguments": {}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/currency-conversion/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {}, 'name': 'list_currencies'}},
)
print(resp.json())

report_feedback

Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: general)
curl -X POST "https://context.gnist.ai/mcp/currency-conversion/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/currency-conversion/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())

Common Patterns

Search then retrieve
Use list_currencies to find items, then get_exchange_rates to get full details. This two-step pattern is common for exploring data before drilling down.

FAQ

What data does Currency Conversion provide?

Real-time and historical currency conversion — 30+ currencies with ECB reference rates. It exposes 4 tools: convert_currency, get_exchange_rates, list_currencies, report_feedback.

What do I need to get started?

A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.

What format does the Currency Conversion API return?

JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.

Next Steps

Related Tutorials