INNER CODE UNIT · Python
get_quote
Spoofkapoof/TradingViewMCPServer · tradingview_mcp/server.py:144
def get_quote(symbol: str) -> Dict[str, Any]:
"""
Universal quote fetcher for all asset types.
Args:
symbol: Symbol (e.g., 'EURUSD', 'AAPL', 'BTC')
Returns:
Quote data or error
"""
asset_type, formatted_symbol = detect_asset_type(symbol)
logger.info(f"Fetching quote for {symbol} (type: {asset_type})")
if asset_type == "forex":
return api_client.get_forex_quote(formatted_symbol)
elif asset_type == "crypto":
return api_client.get_crypto_quote(formatted_symbol)