get_all_snapshots
Retrieve real-time snapshots for US stocks, with optional ticker filtering to limit data size.
Instructions
Real-time snapshot for multiple/all US stocks. Use tickers to filter — calling with no
filter returns the entire market and may be very large.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tickers | No | Optional list of symbols. If None, returns all. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/massive_mcp/tools/snapshots.py:20-29 (handler)Handler function for the get_all_snapshots tool. Calls the Massive API at /v2/snapshot/locale/us/markets/stocks/tickers with an optional comma-separated tickers filter.
@mcp.tool() async def get_all_snapshots(tickers: list[str] | None = None) -> dict[str, Any]: """Real-time snapshot for multiple/all US stocks. Use `tickers` to filter — calling with no filter returns the entire market and may be very large. Args: tickers: Optional list of symbols. If None, returns all. """ params = {"tickers": ",".join(tickers)} if tickers else None return await client.get("/v2/snapshot/locale/us/markets/stocks/tickers", params) - src/massive_mcp/tools/snapshots.py:20-21 (registration)The tool is registered via the @mcp.tool() decorator in the register() function, which is called from server.py.
@mcp.tool() async def get_all_snapshots(tickers: list[str] | None = None) -> dict[str, Any]: - Input schema: accepts an optional list of ticker strings. If None, returns snapshots for all stocks.
async def get_all_snapshots(tickers: list[str] | None = None) -> dict[str, Any]: - Helper logic: serializes tickers list to comma-separated string for the API query parameter, or passes None for no filter.
params = {"tickers": ",".join(tickers)} if tickers else None return await client.get("/v2/snapshot/locale/us/markets/stocks/tickers", params)