Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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
      );
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vikramgorla/mcp-swiss'

If you have feedback or need assistance with the MCP directory API, please join our Discord server