get_short_volume
Retrieve daily short-volume data for a stock ticker, with optional date filtering and pagination.
Instructions
Daily short-volume data for a ticker.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticker | Yes | Stock symbol. | |
| date_gte | No | Inclusive lower bound on date. | |
| limit | No | Max rows. Default 30. | |
| cursor | No | Pagination cursor. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The actual handler function for the 'get_short_volume' tool. It takes ticker, date_gte, limit, and cursor parameters, and calls the Massive REST API at '/stocks/v1/short-volume' to return daily short-volume data.
@mcp.tool() async def get_short_volume( ticker: str, date_gte: str | None = None, limit: int = 30, cursor: str | None = None, ) -> dict[str, Any]: """Daily short-volume data for a ticker. Args: ticker: Stock symbol. date_gte: Inclusive lower bound on date. limit: Max rows. Default 30. cursor: Pagination cursor. """ return await client.get( "/stocks/v1/short-volume", { "ticker": ticker, "date.gte": date_gte, "limit": limit, "cursor": cursor, "order": "desc", }, ) - src/massive_mcp/tools/financials.py:12-89 (registration)The 'register' function decorates the tool with @mcp.tool(), registering it with the FastMCP server. The registration happens inside a loop in server.py line 48 which calls financials.register(mcp, client).
def register(mcp: FastMCP, client: MassiveClient) -> None: @mcp.tool() async def get_financials( ticker: str, timeframe: Timeframe = "quarterly", limit: int = 4, cursor: str | None = None, ) -> dict[str, Any]: """Financial statements (income, balance sheet, cash flow, ratios) for a ticker. Args: ticker: Stock symbol. timeframe: "annual", "quarterly", or "ttm". Default "quarterly". limit: Max periods returned. Default 4 (last year). cursor: Pagination cursor. """ return await client.get( "/vX/reference/financials", { "ticker": ticker, "timeframe": timeframe, "limit": limit, "cursor": cursor, "order": "desc", }, ) @mcp.tool() 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", }, ) @mcp.tool() async def get_short_volume( ticker: str, date_gte: str | None = None, limit: int = 30, cursor: str | None = None, ) -> dict[str, Any]: """Daily short-volume data for a ticker. Args: ticker: Stock symbol. date_gte: Inclusive lower bound on date. limit: Max rows. Default 30. cursor: Pagination cursor. """ return await client.get( "/stocks/v1/short-volume", { "ticker": ticker, "date.gte": date_gte, "limit": limit, "cursor": cursor, "order": "desc", }, ) - Imports and type alias used by the handler. MassiveClient (imported from ..client) provides the HTTP client with retry/auth logic used in the handler.
from __future__ import annotations from typing import Any, Literal from fastmcp import FastMCP from ..client import MassiveClient Timeframe = Literal["annual", "quarterly", "ttm"]