Skip to main content
Glama
get_currencies.py1.32 kB
""" Get fiat currency exchange rates for token price conversion. """ import json from mcp import types from ...helpers import make_odos_request from ...mcp import mcp # class GetCurrenciesArgs(BaseModel): # """No arguments needed for this endpoint""" @mcp.tool( name="get_currencies", description="Get list of available currencies and exchange rates for token prices", ) # disable-next-line=unused-argument # using _args makes the library error. async def get_currencies() -> list[types.TextContent]: """ Gets list of available currencies from Odos API. """ try: response_data = await make_odos_request("/pricing/currencies", method="GET") output = { "message": "Successfully fetched available currencies.", "currencies": response_data.get("currencies", []), } return [types.TextContent(type="text", text=json.dumps(output, indent=2))] except ConnectionError as e: return [ types.TextContent( type="text", text=f"❌ API Error in get_currencies: {str(e)}" ) ] except (ValueError, KeyError, TypeError) as e: return [ types.TextContent( type="text", text=f"❌ Unexpected Error in get_currencies: {str(e)}" ) ]

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/odos-xyz/odos-mcp'

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