current_price
Fetch live stock prices from Yahoo Finance. Enter a stock symbol to get current market data for trading decisions.
Instructions
Fetch the live price of a stock symbol.
Args: symbol: Stock ticker symbol (e.g. AAPL, TSLA) - This should be a valid symbol supported by Yahoo Finance.
Returns: The current market price as a float, or -1.0 if the price could not be fetched.
Example: get_live_price("AAPL") -> 193.45
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- trader_tools.py:145-159 (handler)The current_price tool is defined and registered using the @mcp.tool() decorator, and it calls the get_live_price helper function.
@mcp.tool() def current_price(symbol: str) -> float: """Fetch the live price of a stock symbol. Args: symbol: Stock ticker symbol (e.g. AAPL, TSLA) - This should be a valid symbol supported by Yahoo Finance. Returns: The current market price as a float, or -1.0 if the price could not be fetched. Example: get_live_price("AAPL") -> 193.45 """ return get_live_price(symbol)