list_currencies
Retrieve currency codes, names, and regions from the Swiss National Bank for CHF exchange rate data. Access Swiss open data without API keys.
Instructions
List all currencies available from the Swiss National Bank (SNB) for CHF exchange rate data. Returns currency codes, names, and regions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/modules/snb.ts:202-223 (handler)The 'handleListCurrencies' function fetches currency dimensions from the SNB API and returns a formatted JSON string with currency details.
async function handleListCurrencies(): Promise<string> { const currencies = await fetchDimensions(); const result = currencies.map((c) => ({ code: c.code, name: c.name, region: c.region || undefined, units: c.units === 100 ? `CHF per 100 ${c.code}` : `CHF per 1 ${c.code}`, seriesId: c.seriesId, })); return JSON.stringify( { currencies: result, count: result.length, note: "All rates are CHF per unit. Series with '100' suffix (e.g. JPY100) show CHF per 100 units.", source: "https://data.snb.ch", }, null, 2 ); }