get_top_movers
Retrieve top US stock gainers or losers for the current trading day. Specify direction to get either gainers or losers.
Instructions
Top US stock gainers or losers for the current trading day.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| direction | Yes | "gainers" or "losers". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/massive_mcp/tools/snapshots.py:31-38 (handler)The tool handler function that fetches top gainers/losers by calling the API endpoint /v2/snapshot/locale/us/markets/stocks/{direction}
@mcp.tool() async def get_top_movers(direction: Literal["gainers", "losers"]) -> dict[str, Any]: """Top US stock gainers or losers for the current trading day. Args: direction: "gainers" or "losers". """ return await client.get(f"/v2/snapshot/locale/us/markets/stocks/{direction}") - Input schema: direction is Literal["gainers", "losers"]; returns dict[str, Any]
async def get_top_movers(direction: Literal["gainers", "losers"]) -> dict[str, Any]: - src/massive_mcp/server.py:37-48 (registration)Registration: server.py calls snapshots.register(mcp, client) which registers get_top_movers via @mcp.tool() decorator
for module in ( aggregates, quotes, snapshots, tickers, news, reference, indicators, corporate, financials, ): module.register(mcp, client) - Uses MassiveClient from the client module as the helper to make API calls
from ..client import MassiveClient def register(mcp: FastMCP, client: MassiveClient) -> None: