get_snapshot
Retrieves a real-time stock snapshot for a ticker, including last trade, last quote, and daily open/high/low/close data.
Instructions
Real-time snapshot for a single stock: last trade, last quote, day OHLC, prev day OHLC.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticker | Yes | Stock symbol (e.g. "TSLA"). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/massive_mcp/tools/snapshots.py:12-18 (handler)The actual tool handler function 'get_snapshot'—an async function that takes a ticker string and calls the Massive API endpoint /v2/snapshot/locale/us/markets/stocks/tickers/{ticker} to return real-time snapshot data.
async def get_snapshot(ticker: str) -> dict[str, Any]: """Real-time snapshot for a single stock: last trade, last quote, day OHLC, prev day OHLC. Args: ticker: Stock symbol (e.g. "TSLA"). """ return await client.get(f"/v2/snapshot/locale/us/markets/stocks/tickers/{ticker}") - src/massive_mcp/tools/snapshots.py:10-18 (registration)The 'register' function that decorates 'get_snapshot' with @mcp.tool() to register it with the FastMCP server.
def register(mcp: FastMCP, client: MassiveClient) -> None: @mcp.tool() async def get_snapshot(ticker: str) -> dict[str, Any]: """Real-time snapshot for a single stock: last trade, last quote, day OHLC, prev day OHLC. Args: ticker: Stock symbol (e.g. "TSLA"). """ return await client.get(f"/v2/snapshot/locale/us/markets/stocks/tickers/{ticker}") - src/massive_mcp/tools/__init__.py:9-9 (registration)The snapshots module is imported in the tools __init__.py, enabling registration.
snapshots, - src/massive_mcp/server.py:37-48 (registration)The 'build_server' function calls module.register(mcp, client) for snapshots (and others), which registers all tools including get_snapshot with the MCP server.
for module in ( aggregates, quotes, snapshots, tickers, news, reference, indicators, corporate, financials, ): module.register(mcp, client)