get_news
Fetch news articles about stocks. Optionally filter by ticker symbol, date range, and set pagination.
Instructions
Recent news articles, optionally filtered by ticker.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticker | No | Optional symbol filter (e.g. "AAPL"). | |
| published_utc_gte | No | Inclusive lower bound on publish time ("YYYY-MM-DD" or RFC3339). | |
| published_utc_lte | No | Inclusive upper bound. | |
| limit | No | Max articles. Default 10. | |
| cursor | No | Pagination cursor. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/massive_mcp/tools/news.py:12-39 (handler)The `get_news` async function that executes the tool logic. It calls the Massive API endpoint `/v2/reference/news` with optional ticker filter, date range, limit, cursor, and sorting parameters.
async def get_news( ticker: str | None = None, published_utc_gte: str | None = None, published_utc_lte: str | None = None, limit: int = 10, cursor: str | None = None, ) -> dict[str, Any]: """Recent news articles, optionally filtered by ticker. Args: ticker: Optional symbol filter (e.g. "AAPL"). published_utc_gte: Inclusive lower bound on publish time ("YYYY-MM-DD" or RFC3339). published_utc_lte: Inclusive upper bound. limit: Max articles. Default 10. cursor: Pagination cursor. """ return await client.get( "/v2/reference/news", { "ticker": ticker, "published_utc.gte": published_utc_gte, "published_utc.lte": published_utc_lte, "limit": limit, "cursor": cursor, "order": "desc", "sort": "published_utc", }, ) - src/massive_mcp/tools/news.py:10-11 (registration)The `register` function decorates `get_news` with `@mcp.tool()` to register it as an MCP tool.
def register(mcp: FastMCP, client: MassiveClient) -> None: @mcp.tool() - src/massive_mcp/tools/news.py:13-18 (schema)Input schema/type hints for `get_news`: ticker (optional str), published_utc_gte/lte (optional str), limit (int, default 10), cursor (optional str). Returns dict[str, Any].
ticker: str | None = None, published_utc_gte: str | None = None, published_utc_lte: str | None = None, limit: int = 10, cursor: str | None = None, ) -> dict[str, Any]: - src/massive_mcp/server.py:37-48 (helper)The server loop that calls `module.register(mcp, client)` for each module including `news`, which triggers the registration of the `get_news` tool.
for module in ( aggregates, quotes, snapshots, tickers, news, reference, indicators, corporate, financials, ): module.register(mcp, client) - The news module is imported and exported in the tools package `__init__.py`, making `register` accessible for tool registration.
news, quotes, reference, snapshots, tickers, )