Skip to main content
Glama
drasticstatic

robinhood-mcp

robinhood_get_positions

Retrieve all current stock positions from your Robinhood portfolio, including price, quantity, average buy price, equity, and percent change for each holding.

Instructions

Get all current stock positions with details.

Returns a dict mapping stock symbols to position details including price, quantity, average buy price, equity, and percent change.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'robinhood_get_positions'. Decorated with @mcp.tool(), ensures the user is logged in, then delegates to get_positions() from tools module.
    @mcp.tool()
    def robinhood_get_positions() -> dict:
        """Get all current stock positions with details.
    
        Returns a dict mapping stock symbols to position details including
        price, quantity, average buy price, equity, and percent change.
        """
        _ensure_logged_in()
        return get_positions()
  • Schema/type definition: TUPLES of expected fields for position data (price, quantity, avg buy price, equity, percent_change, equity_change).
    _POSITION_FIELDS = (
        "price",
        "quantity",
        "average_buy_price",
        "equity",
        "percent_change",
        "equity_change",
    )
  • FastMCP server instantiation - the decorator @mcp.tool() on robinhood_get_positions registers it as an MCP tool.
    # Initialize FastMCP server (older versions don't accept description kwarg).
    try:
        mcp = FastMCP(
            "robinhood-mcp",
            description="Read-only research tools for Robinhood portfolio data",
        )
  • Core implementation get_positions() - fetches all stock positions via rh.account.build_holdings with caching (30s TTL) and thread-safe lock.
    def get_positions() -> dict[str, dict[str, Any]]:
        """Get all current stock positions with details.
    
        Returns:
            Dict mapping symbol to position details including:
            - price, quantity, average_buy_price
            - equity, percent_change, equity_change
        """
        global _positions_cache, _positions_cache_ts
    
        now = time.monotonic()
        cached = _get_positions_cached(now)
        if cached is not None:
            return cached
    
        with _positions_cache_lock:
            now = time.monotonic()
            if (
                _positions_cache is not None
                and (now - _positions_cache_ts) < _POSITIONS_CACHE_TTL_SECONDS
            ):
                return deepcopy(_positions_cache)
    
            result = _safe_call(rh.account.build_holdings)
            if not isinstance(result, dict):
                raise RobinhoodError(
                    f"Unexpected build_holdings response type: {type(result).__name__}"
                )
            _positions_cache = deepcopy(result)
            _positions_cache_ts = time.monotonic()
            return result
Behavior3/5

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

With no annotations, the description states it 'returns a dict mapping stock symbols to position details,' which implies a read operation. However, it does not explicitly confirm safety (read-only, no side effects) or address data freshness, pagination, or required authentication.

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 consists of two concise sentences: the first states the tool's purpose, and the second details the return format. No redundant or extraneous information, making it highly efficient.

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 tool with no parameters and an existing output schema, the description adequately covers what the tool does and what it returns, including specific fields. It lacks an explicit statement of read-only behavior, but this is minor given the nature of a 'get' operation. Overall, it is sufficiently complete.

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

Parameters4/5

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

The input schema has no parameters (0 params, 100% coverage). The description does not need to add parameter details. Baseline for 0 params is 4, and the description appropriately omits extra parameter information.

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 all current stock positions with details,' specifying the verb ('Get') and resource ('stock positions'). It distinguishes from the sibling 'robinhood_get_position' by implying plural (all positions) and mentions the return format (dict mapping symbols to details).

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 like 'robinhood_get_position' or 'robinhood_get_portfolio'. The description does not provide context, preconditions, or exclusions.

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