get_supported_currencies
Retrieve available three-letter currency codes to identify which currencies can be used for exchange rate queries and currency conversion operations.
Instructions
Returns a list of three-letter currency codes for the supported currencies.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/frankfurtermcp/server.py:76-90 (handler)The async handler function that executes the tool logic by fetching the list of supported currencies from the Frankfurter API '/currencies' endpoint.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}")
- src/frankfurtermcp/server.py:30-37 (registration)Registration of the 'get_supported_currencies' tool in the tools list of the FrankfurterMCP class, including tags and annotations.{ "fn": "get_supported_currencies", "tags": ["currency-rates", "supported-currencies"], "annotations": { "readOnlyHint": True, "openWorldHint": True, }, },