INNER CODE UNIT · Python
get_price
Spoofkapoof/TradingViewMCPServer · tradingview_mcp/server.py:248
def get_price(symbol: str) -> dict:
"""
Get current price for any asset (Forex, Stock, or Crypto).
Args:
symbol: Symbol (e.g., 'EURUSD', 'AAPL', 'BTC', 'TSLA')
Returns:
Current price, bid/ask, asset type, and additional data
"""
quote = get_quote(symbol)
if "error" in quote:
return quote
return {
"symbol": quote.get("symbol", symbol),
"asset_type": quote.get("asset_type", "unknown"),