Skip to main content
Glama

get_fundamentals

Retrieve core financial data for stock analysis, including fundamentals like earnings, revenue, and balance sheet metrics to support investment decisions.

Instructions

Retrieves core financial and fundamental data.

Args:
    symbol: The ticker symbol.
    
Returns:
    Dictionary containing fundamental data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the get_fundamentals tool. It fetches key fundamental metrics (PE ratios, margins, market cap, etc.) from Yahoo Finance using yfinance.Ticker(symbol).info and returns a filtered dictionary of available metrics.
    def get_fundamentals(symbol: str) -> Dict[str, Any]:
        """
        Retrieves core financial and fundamental data.
        
        Args:
            symbol: The ticker symbol.
            
        Returns:
            Dictionary containing fundamental data.
        """
        try:
            ticker = yf.Ticker(symbol)
            info = ticker.info
            # Filter for key metrics to avoid overwhelming context
            key_metrics = [
                "marketCap", "forwardPE", "trailingPE", "pegRatio", 
                "priceToBook", "profitMargins", "revenueGrowth", 
                "returnOnEquity", "totalDebt", "totalCash", "sector", "industry"
            ]
            return {k: info.get(k) for k in key_metrics if k in info}
        except Exception as e:
            return {"error": f"Error fetching fundamentals for {symbol}: {str(e)}"}
  • server.py:370-373 (registration)
    Registers the get_fundamentals tool in the MCP server under the 'Market Data' category by applying the @mcp.tool() decorator via the register_tools helper function.
    register_tools(
        [get_price, get_fundamentals, get_orderbook],
        "Market Data"
    )
  • app.py:47-47 (registration)
    Imports the get_fundamentals function from tools.market_data for use in the application (Gradio UI tools map).
    from tools.market_data import get_price, get_fundamentals, get_orderbook
  • server.py:12-12 (registration)
    Imports the get_fundamentals function required for MCP tool registration in the server.
    from tools.market_data import get_price, get_fundamentals, get_orderbook
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 of behavioral disclosure. It states the tool 'Retrieves' data, implying a read-only operation, but doesn't mention authentication needs, rate limits, data freshness, or error handling. For a tool with no annotations, this leaves significant behavioral gaps.

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 appropriately sized with three sentences: purpose, args, and returns. It's front-loaded with the core function. However, the 'Returns' section is redundant given the output schema exists, slightly reducing efficiency.

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's moderate complexity (financial data retrieval), no annotations, and an output schema present, the description is minimally adequate. It covers the basic purpose and parameter, but lacks context on data scope (e.g., which fundamentals), alternatives, or behavioral traits. The output schema reduces the need to explain returns, but more completeness is needed for effective use.

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?

The description adds minimal semantics: it lists 'symbol' as 'The ticker symbol', which matches the schema's title 'Symbol'. With 0% schema description coverage, the description compensates slightly by naming the parameter, but doesn't provide format details (e.g., exchange prefixes), examples, or constraints beyond what's implied. Baseline is 3 due to the single parameter being documented.

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

Purpose3/5

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

The description states the tool 'Retrieves core financial and fundamental data', which provides a clear verb ('Retrieves') and resource ('core financial and fundamental data'). However, it doesn't differentiate from siblings like get_price, get_technical_summary, or get_account_info, which also retrieve financial data. The purpose is clear but lacks sibling differentiation.

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. It doesn't mention when to prefer get_fundamentals over get_price (for price data) or get_technical_summary (for technical indicators), nor does it specify prerequisites or exclusions. Usage is implied by the name but not explicitly stated.

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

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/N-lia/MonteWalk'

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