get_currency_rate
Retrieve live USD exchange rates for any country's currency using ISO country codes. Provides updated currency conversion data every 4 hours for financial calculations and international transactions.
Instructions
Get the live USD exchange rate for a country's currency. Updated every 4 hours. Requires Starter plan or above.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| country_code | Yes | ISO2 or ISO3 country code (e.g. AR, BR, JP) |
Implementation Reference
- src/tools/currency.ts:6-16 (handler)The tool 'get_currency_rate' is registered and implemented within the server.tool call in this file. The handler logic directly fetches data from the API.
server.tool( 'get_currency_rate', 'Get the live USD exchange rate for a country\'s currency. Updated every 4 hours. Requires Starter plan or above.', { country_code: z.string().min(2).max(3).describe('ISO2 or ISO3 country code (e.g. AR, BR, JP)'), }, async ({ country_code }) => { const data = await apiGet(`/v1/api/geo/countries/${country_code.toUpperCase()}/currency-rate`); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] }; } );