Skip to main content
Glama
VaishnaviK23

Trading MCP Server

by VaishnaviK23

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
NameRequiredDescriptionDefault
symbolYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • 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)

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/VaishnaviK23/Trading-MCP-Server'

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