Skip to main content
Glama
danielbres

massive-mcp

by danielbres

get_short_interest

Retrieve bi-monthly short interest reports for a stock ticker. Filter by settlement date and paginate results.

Instructions

Bi-monthly short interest reports for a ticker.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tickerYesStock symbol.
settlement_date_gteNoInclusive lower bound on settlement date.
limitNoMax rows. Default 12.
cursorNoPagination cursor.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_short_interest' tool. It makes an HTTP GET request to '/stocks/v1/short-interest' with ticker, settlement_date_gte, limit, and cursor parameters. Registered via the @mcp.tool() decorator in the register() function.
    async def get_short_interest(
        ticker: str,
        settlement_date_gte: str | None = None,
        limit: int = 12,
        cursor: str | None = None,
    ) -> dict[str, Any]:
        """Bi-monthly short interest reports for a ticker.
    
        Args:
            ticker: Stock symbol.
            settlement_date_gte: Inclusive lower bound on settlement date.
            limit: Max rows. Default 12.
            cursor: Pagination cursor.
        """
        return await client.get(
            "/stocks/v1/short-interest",
            {
                "ticker": ticker,
                "settlement_date.gte": settlement_date_gte,
                "limit": limit,
                "cursor": cursor,
                "order": "desc",
            },
        )
  • The register() function that receives the FastMCP server and client. The @mcp.tool() decorator on line 39 registers 'get_short_interest' as an MCP tool. registration is invoked from server.py line 48: module.register(mcp, client).
    def register(mcp: FastMCP, client: MassiveClient) -> None:
        @mcp.tool()
  • build_server() iterates over tool modules (including 'financials') and calls module.register(mcp, client). This is where the financials module (containing get_short_interest) gets registered with the FastMCP server.
    for module in (
        aggregates,
        quotes,
        snapshots,
        tickers,
        news,
        reference,
        indicators,
        corporate,
        financials,
    ):
        module.register(mcp, client)
  • The MassiveClient.get() helper called by get_short_interest. Handles HTTP GET requests with retry logic, auth (bearer or query param), error handling, and response trimming.
    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}
        if self._settings.auth_mode == "query":
            merged["apiKey"] = self._settings.api_key
    
        last_exc: Exception | None = None
        for attempt in range(MAX_RETRIES):
            try:
                resp = await self._http.get(path, params=merged)
            except httpx.HTTPError as exc:
                last_exc = exc
                await asyncio.sleep(2**attempt)
                continue
    
            if resp.status_code == 429:
                retry_after = float(resp.headers.get("Retry-After", 2**attempt))
                await asyncio.sleep(min(retry_after, 30))
                continue
            if 500 <= resp.status_code < 600 and attempt < MAX_RETRIES - 1:
                await asyncio.sleep(2**attempt)
                continue
    
            if resp.status_code == 401:
                hint = (
                    "auth rejected — verify MASSIVE_API_KEY; "
                    "if you used MASSIVE_AUTH_MODE=bearer, try 'query' (or vice versa)"
                )
                raise MassiveAPIError(401, hint, _strip_secrets(str(resp.request.url)))
    
            try:
                data = resp.json()
            except ValueError:
                data = {"raw": resp.text}
    
            if not resp.is_success:
                msg = data.get("error") or data.get("message") or resp.reason_phrase or "request failed"
                raise MassiveAPIError(resp.status_code, str(msg), _strip_secrets(str(resp.request.url)))
    
            return _trim(data) if trim else data
    
        raise MassiveAPIError(0, f"network error after {MAX_RETRIES} retries: {last_exc}", path)
  • The function signature defines the input schema: ticker (str, required), settlement_date_gte (str|None), limit (int, default 12), cursor (str|None). The return type is dict[str, Any]. These are the type annotations and defaults that serve as the tool's parameter schema.
    async def get_short_interest(
        ticker: str,
        settlement_date_gte: str | None = None,
        limit: int = 12,
        cursor: str | None = None,
    ) -> dict[str, Any]:
Behavior3/5

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

The description mentions 'bi-monthly reports,' hinting at the data's periodicity, but with no annotations, it lacks details on read-only behavior, authentication, or rate limits. The output schema covers return structure, but behavioral traits (e.g., pagination via cursor) are only in the schema, not described.

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 sentence that is concise and front-loaded, conveying the core functionality without any unnecessary words. It earns its place by being clear and to the point.

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 (so return values are documented) and the tool's moderate complexity (4 parameters), the description is sufficient. It could add context about the pagination or date filtering, but these are covered in the schema. Overall, it's complete enough for an informed choice.

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?

Input schema has 100% description coverage, so each parameter is already explained (e.g., ticker as 'Stock symbol'). The tool description adds no additional meaning beyond what the schema provides, meeting the baseline for high coverage.

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 tool returns bi-monthly short interest reports for a ticker, specifying both the frequency and the type of data. This distinguishes it from sibling tools like get_short_volume (trading volume) and get_financials (financial statements).

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 the tool should be used when short interest data for a ticker is needed, but it does not explicitly state when to avoid it or compare it to alternatives like get_short_volume. Usage context is inferred, not explained.

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