Skip to main content
Glama
drasticstatic

robinhood-mcp

robinhood_search_symbols

Search for stock symbols by entering a company name or partial ticker. Get matching ticker symbols for portfolio research.

Instructions

Search for stock symbols by company name or ticker.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (company name or partial ticker)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Core implementation: searches Robinhood instruments by symbol (exact match) or company name (fuzzy search via find_instrument_data).
    def search_symbols(query: str) -> list[dict[str, Any]]:
        """Search for stock symbols by company name or ticker.
    
        Args:
            query: Search query (company name or partial ticker).
    
        Returns:
            List of matching instruments with symbol, name, etc.
        """
        if not query or not isinstance(query, str):
            raise RobinhoodError("Query must be a non-empty string")
    
        query = query.strip()
    
        # Try to get instruments by the query
        try:
            result = rh.stocks.get_instruments_by_symbols(query.upper())
            if result and isinstance(result, list):
                return result
        except Exception:
            pass
    
        # If exact match fails, try search
        try:
            result = rh.stocks.find_instrument_data(query)
            return result if isinstance(result, list) else []
        except Exception as e:
            raise RobinhoodError(f"Search failed: {e}") from e
  • MCP tool registration: decorates robinhood_search_symbols as a FastMCP tool, delegates to tools.search_symbols().
    @mcp.tool()
    def robinhood_search_symbols(query: str) -> list:
        """Search for stock symbols by company name or ticker.
    
        Args:
            query: Search query (company name or partial ticker)
    
        Returns list of matching instruments with symbol, name,
        and other details.
        """
        _ensure_logged_in()
        return search_symbols(query)
  • Import of search_symbols from the tools module into server.py.
    from .tools import (
        RobinhoodError,
        get_dividends,
        get_earnings,
        get_fundamentals,
        get_historicals,
        get_news,
        get_options_positions,
        get_portfolio,
        get_position,
        get_positions,
        get_quote,
        get_ratings,
        get_watchlist,
        search_symbols,
    )
    
    # Load environment variables
    load_dotenv()
    
    # Initialize FastMCP server (older versions don't accept description kwarg).
    try:
        mcp = FastMCP(
            "robinhood-mcp",
            description="Read-only research tools for Robinhood portfolio data",
        )
    except TypeError:
        mcp = FastMCP("robinhood-mcp")
    
    # Track login state
    _login_attempted = False
    _login_error: str | None = None
    _login_lock = threading.Lock()
    _cached_login_status: bool | None = None
    _cached_login_status_ts = 0.0
  • Error-handling wrapper used by other tools but not directly by search_symbols (which handles its own errors inline).
    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
Behavior3/5

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

No annotations are provided, so the description carries full burden. It implies read-only search behavior but does not explicitly state if it is safe or mention any side effects.

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?

Single sentence with no padding, directly communicates the tool's function.

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

Completeness4/5

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

For a simple search tool with one parameter and an output schema, the description is largely complete. It could mention that the output is a list, but the output schema likely covers that.

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 coverage is 100% and the schema parameter description already explains the query. The tool description adds minimal extra meaning beyond restating the schema.

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 the verb 'search' and resource 'stock symbols' with the method 'by company name or ticker'. This distinguishes it from sibling get_* tools that retrieve specific data.

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, such as suggesting to use it for symbol discovery then other tools for details.

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