Skip to main content
Glama
drasticstatic

robinhood-mcp

robinhood_get_earnings

Get earnings data for any stock using its ticker symbol. View revenue, EPS, and earnings dates to support investment research and portfolio analysis.

Instructions

Get earnings data for a stock.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesStock ticker symbol

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The @mcp.tool() decorator registers 'robinhood_get_earnings' as an MCP tool. The function calls get_earnings(symbol) after ensuring the user is logged in.
    @mcp.tool()
    def robinhood_get_earnings(symbol: str) -> list:
        """Get earnings data for a stock.
    
        Args:
            symbol: Stock ticker symbol
    
        Returns list of earnings reports with EPS, report date,
        analyst estimates, and actual vs expected.
        """
        _ensure_logged_in()
        return get_earnings(symbol)
  • Actual handler/implementation of get_earnings. It normalizes the symbol, calls rh.stocks.get_earnings via _safe_call, and returns the result as a list.
    def get_earnings(symbol: str) -> list[dict[str, Any]]:
        """Get earnings data for a stock.
    
        Args:
            symbol: Stock ticker symbol.
    
        Returns:
            List of earnings reports with eps, report date, estimates, etc.
        """
        symbol = _normalize_symbol(symbol)
        result = _safe_call(rh.stocks.get_earnings, symbol)
        return result if isinstance(result, list) else []
  • _normalize_symbol helper: validates and uppercases the ticker symbol, called by get_earnings.
    def _normalize_symbol(symbol: str) -> str:
        """Normalize and validate ticker symbols."""
        if not symbol or not isinstance(symbol, str):
            raise RobinhoodError("Symbol must be a non-empty string")
        symbol = symbol.upper().strip()
        if not symbol:
            raise RobinhoodError("Symbol must be a non-empty string")
        return symbol
  • _safe_call helper: wraps robin_stocks API calls with error handling, used by get_earnings to call rh.stocks.get_earnings.
    def _safe_call(func: Callable[..., Any], *args, **kwargs) -> Any:
        """Safely call a robin_stocks function with error handling.
    
        Args:
            func: The robin_stocks function to call.
            *args: Positional arguments.
            **kwargs: Keyword arguments.
    
        Returns:
            The function result.
    
        Raises:
            RobinhoodError: If the call fails.
        """
        try:
            result = func(*args, **kwargs)
            if result is None:
                raise RobinhoodError("API returned None - you may need to login first")
            return result
        except RobinhoodError:
            raise
        except Exception as e:
            raise RobinhoodError(f"API call failed: {e}") from e
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It does not mention whether the tool is read-only, what data is returned (e.g., quarterly earnings, surprise factors), or any constraints like date range. A minimal statement like 'Returns earnings per share and revenue for recent quarters' would add transparency.

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

Conciseness5/5

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

The description is a single, concise sentence that is front-loaded and free of unnecessary words. Every word earns its place.

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 presence of an output schema (not shown), the description does not need to detail return values. However, it lacks context about how earnings data relates to sibling tools and does not compensate for missing annotations. It is minimally complete for a simple lookup tool but feels lacking in a rich API with many similar endpoints.

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 input schema has 100% coverage for the single 'symbol' parameter, with a standard description. The tool description adds no extra meaning beyond the schema. Baseline 3 is appropriate as the schema already documents the parameter adequately.

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

Purpose5/5

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

The description clearly states 'Get earnings data for a stock,' which specifies the action (get), resource (earnings data), and scope (for a stock). It effectively distinguishes from sibling tools like robinhood_get_dividends or robinhood_get_fundamentals by naming a distinct data type.

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?

No guidance on when to use this tool versus alternatives. With many sibling tools covering related financial data, the description should indicate contexts or criteria for selecting earnings data (e.g., 'Use for company earnings reports; for broader financial metrics, see get_fundamentals').

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/drasticstatic/robinhood-mcp'

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