get_exchange_rate
Retrieve current fiat currency exchange rates for cryptocurrency trading and financial analysis using real-time data.
Instructions
Get list of fiat currency exchange rates
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/desk3_service/server.py:56-65 (handler)The core handler function implementing the get_exchange_rate tool by fetching data from the Desk3 API endpoint.async def get_exchange_rate() -> dict[str, Any]: """ Get list of fiat currency exchange rates. :return: Exchange rate data """ url = 'https://mcp.desk3.io/v1/market/exchangeRate' try: return request_api('get', url) except Exception as e: raise RuntimeError(f"Failed to fetch exchange rate data: {e}")
- src/desk3_service/server.py:534-542 (registration)Registration of the 'get_exchange_rate' tool in the MCP server's list_tools handler, including description and empty input schema.types.Tool( name="get_exchange_rate", description="Get list of fiat currency exchange rates", inputSchema={ "type": "object", "properties": {}, "required": [], }, ),
- src/desk3_service/server.py:724-734 (handler)Dispatch handler in the MCP @server.call_tool that executes get_exchange_rate and returns the result as formatted JSON text content.case "get_exchange_rate": try: data = await get_exchange_rate() return [ types.TextContent( type="text", text=json.dumps(data, indent=2), ) ] except Exception as e: raise RuntimeError(f"Failed to fetch exchange rate data: {e}")
- src/desk3_service/server.py:537-541 (schema)JSON Schema definition for the tool's input parameters (none required).inputSchema={ "type": "object", "properties": {}, "required": [], },