Skip to main content
Glama
narumiruna

Yahoo Finance MCP Server

get_ticker_info

Fetch detailed stock data such as company info, financials, trading metrics, and governance details using a specific stock symbol via the Yahoo Finance MCP Server.

Instructions

Retrieve stock data including company info, financials, trading metrics and governance data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesThe stock symbol

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_ticker_info' tool. It fetches comprehensive stock information using yfinance.Ticker, converts timestamps to readable format, and returns the data as a JSON string. The @mcp.tool() decorator handles registration, and the Annotated parameter defines the input schema.
    @mcp.tool()
    def get_ticker_info(symbol: Annotated[str, Field(description="The stock symbol")]) -> str:
        """Retrieve stock data including company info, financials, trading metrics and governance data."""
        ticker = yf.Ticker(symbol)
    
        # Convert timestamps to human-readable format
        info = ticker.info
        for key, value in info.items():
            if not isinstance(key, str):
                continue
    
            if key.lower().endswith(("date", "start", "end", "timestamp", "time", "quarter")):
                try:
                    info[key] = datetime.fromtimestamp(value).strftime("%Y-%m-%d %H:%M:%S")
                except Exception as e:
                    logger.error("Unable to convert {}: {} to datetime, got error: {}", key, value, e)
                    continue
    
        return json.dumps(info, ensure_ascii=False)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the tool retrieves data, implying a read-only operation, but doesn't disclose behavioral traits like rate limits, authentication needs, data freshness, error handling, or response format. This leaves significant gaps for an agent to understand how to use it effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the purpose and lists data types concisely. There's no wasted text, though it could be slightly more structured by separating key points.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema, the description doesn't need to explain return values. However, with no annotations and a single parameter, it adequately covers the basics but lacks depth on behavioral aspects like data sources or limitations, making it minimally viable but with clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the parameter 'symbol' clearly documented as 'The stock symbol'. The description adds no additional meaning beyond this, such as format examples (e.g., 'AAPL' for Apple) or validation rules. Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Retrieve' and the resource 'stock data', specifying what types of data are included (company info, financials, trading metrics, governance data). It distinguishes from siblings like 'get_price_history' by focusing on comprehensive data rather than historical prices, though it doesn't explicitly name alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_price_history' or 'search'. It doesn't mention prerequisites, such as needing a valid stock symbol, or contextual factors like real-time versus delayed data.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/narumiruna/yfinance-mcp'

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