Skip to main content
Glama
danielbres

massive-mcp

by danielbres

get_previous_close

Retrieve the previous trading day's open, high, low, and close prices for a stock ticker, optionally adjusted for splits.

Instructions

Previous trading day's OHLC for a single stock ticker.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tickerYesStock symbol (e.g. "NVDA").
adjustedNoAdjust for splits. Default true.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The get_previous_close async function that implements the tool logic. It calls client.get() on path '/v2/aggs/ticker/{ticker}/prev' with an 'adjusted' query parameter.
    async def get_previous_close(ticker: str, adjusted: bool = True) -> dict[str, Any]:
        """Previous trading day's OHLC for a single stock ticker.
    
        Args:
            ticker: Stock symbol (e.g. "NVDA").
            adjusted: Adjust for splits. Default true.
        """
        return await client.get(
            f"/v2/aggs/ticker/{ticker}/prev",
            {"adjusted": str(adjusted).lower()},
        )
  • The tools __init__.py imports the aggregates module so its register() function can be called.
    from . import (
        aggregates,
        corporate,
        financials,
        indicators,
        news,
        quotes,
        reference,
        snapshots,
        tickers,
    )
    
    __all__ = [
        "aggregates",
        "corporate",
        "financials",
        "indicators",
        "news",
        "quotes",
        "reference",
        "snapshots",
        "tickers",
    ]
  • The build_server() function calls module.register(mcp, client) for each tool module including aggregates, which registers get_previous_close as an MCP tool.
    for module in (
        aggregates,
        quotes,
        snapshots,
        tickers,
        news,
        reference,
        indicators,
        corporate,
        financials,
    ):
        module.register(mcp, client)
  • The register() function that uses @mcp.tool() decorator to register get_previous_close as a FastMCP tool.
    def register(mcp: FastMCP, client: MassiveClient) -> None:
  • The client.get() helper method that executes the actual HTTP GET request, used by get_previous_close to call the Massive REST API.
    async def get(
        self, path: str, params: dict[str, Any] | None = None, *, trim: bool = True
    ) -> dict[str, Any]:
        merged: dict[str, Any] = {k: v for k, v in (params or {}).items() if v is not None}
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 only states the basic purpose, omitting behavioral traits like limitations (e.g., market holidays, timezone), the meaning of the 'adjusted' parameter, or that only OHLC is returned. Minimal transparency.

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 concise sentence with no waste, front-loading the key action. However, it may be slightly under-specified for a tool with two parameters and no additional context.

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?

Given the presence of an output schema, the description need not explain return values. It adequately covers the basic purpose and ticker constraint. Lacks details on data bounds but is sufficient for a simple tool.

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 description adds no new meaning beyond 'single stock ticker' and 'previous trading day's OHLC.' The schema already describes parameters adequately, so the description adds minimal value.

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 it retrieves the previous trading day's OHLC for a single stock ticker, which is a specific verb and resource. It distinguishes from siblings like get_aggregates (multi-day) and get_last_quote (real-time).

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

Usage Guidelines3/5

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

The description implies usage for a single ticker and previous day's data, but provides no explicit guidance on when to use it versus alternatives. Sibling tool names are given but no comparisons or when-not-to-use conditions.

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/danielbres/Massive-MCP'

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