fourget_news_search
Retrieve news articles from the 4get meta search engine, including titles, URLs, descriptions, publication dates, and thumbnails. Paginate results using an optional token.
Instructions
Search for news articles using the 4get meta search engine. Returns recent news with titles, URLs, descriptions, publication dates, and thumbnails. Supports pagination via the 'npt' token.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| page_token | No | ||
| engine | No | Optional search engine override (maps to 4get "scraper" query parameter). | |
| extra_params | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.py:174-184 (handler)MCP tool handler for 'fourget_news_search' - delegates to FourGetClient.news_search() with optional engine/params.
async def fourget_news_search( query: str, page_token: str | None = None, engine: EngineParam = None, extra_params: dict[str, Any] | None = None, ) -> dict[str, Any]: return await client.news_search( query=query, page_token=page_token, options=combine_options(engine, extra_params), ) - src/server.py:166-173 (registration)Registration of the 'fourget_news_search' tool via the @register_tool decorator with description.
@register_tool( name='fourget_news_search', description=( 'Search for news articles using the 4get meta search engine. Returns ' 'recent news with titles, URLs, descriptions, publication dates, and ' "thumbnails. Supports pagination via the 'npt' token." ), ) - src/client.py:143-173 (handler)FourGetClient.news_search() - the actual implementation that calls _call_search with the 'news' endpoint.
async def news_search( self, query: str, *, page_token: str | None = None, options: Mapping[str, Any] | None = None, ) -> dict[str, Any]: """Search for news articles using the 4get API. Args: query: News search query. Ignored when using page_token. page_token: Pagination token from previous response's 'npt' field. options: Additional parameters like date range, source filters. Returns: News search response containing: - status: "ok" for successful requests - news: List of news articles with title, url, description, date - npt: Next page token for pagination (if available) Raises: FourGetAuthError: Rate limited or invalid authentication FourGetAPIError: API returned non-success status FourGetTransportError: Network or HTTP protocol errors Example: >>> result = await client.news_search("artificial intelligence") >>> for article in result.get('news', []): >>> print(f"{article['title']} - {article['date']}") """ return await self._call_search('news', query, page_token=page_token, options=options) - src/server.py:113-122 (helper)Helper function used by the handler to combine engine selection with extra parameters.
def combine_options( engine: SearchEngine | None, extras: dict[str, Any] | None ) -> dict[str, Any] | None: if engine is None and not extras: return None options = dict(extras) if extras else {} if engine is not None: options['scraper'] = engine.value return options - src/server.py:52-55 (schema)Type alias for the optional engine parameter used by fourget_news_search.
EngineParam = Annotated[ SearchEngine | None, Field(description='Optional search engine override (maps to 4get "scraper" query parameter).'), ]