Skip to main content
Glama
anirbanbasu

FrankfurterMCP

get_supported_currencies

Retrieve available currency codes for exchange rate calculations using the Frankfurter API.

Instructions

Returns a list of three-letter currency codes for the supported currencies.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the get_supported_currencies tool. It makes an HTTP GET request to the Frankfurter API's /currencies endpoint to retrieve the list of supported currencies and returns the response content.
    async def get_supported_currencies(self, ctx: Context):
        """Returns a list of three-letter currency codes for the supported currencies."""
        try:
            with self.get_httpx_client() as client:
                await ctx.info(f"Fetching supported currencies from Frankfurter API at {self.frankfurter_api_url}")
                http_response = client.get(f"{self.frankfurter_api_url}/currencies")
                http_response.raise_for_status()
                # Note: The following line could easily be result = http_response.json() but we use content.decode() to
                # demonstrate the TextContent wrapping capability of the get_response_content utility method.
                # Questionable choice? Should we just use # pragma: no cover in the respective branch of get_response_content?
                result = http_response.content.decode()
                return self.get_response_content(response=result, http_response=http_response)
        except httpx.RequestError as e:
            raise ValueError(f"Failed to fetch supported currencies from {self.frankfurter_api_url}. {e}")
  • Registration entry for the get_supported_currencies tool in the tools list of the FrankfurterMCP class, specifying the function name, tags, and annotations.
    {
        "fn": "get_supported_currencies",
        "tags": ["currency-rates", "supported-currencies"],
        "annotations": {
            "readOnlyHint": True,
            "openWorldHint": True,
        },
    },

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/anirbanbasu/frankfurtermcp'

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