search_naver_news
Search for Korean news articles on Naver News using a query, control the number of results (max 100), and sort by date or relevance.
Instructions
Search Naver News (네이버 뉴스) for Korean news articles.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query in Korean or English | |
| max_articles | No | Maximum number of articles to return (default 20, max 100) | |
| sort | No | Sort order — 'date' (최신순) or 'sim' (관련도순) | date |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/korean_data_mcp/server.py:175-196 (handler)The handler function for the 'search_naver_news' tool. It is decorated with @mcp.tool() and accepts query (str), max_articles (int, default 20), and sort (str, default 'date'). It caps max_articles at 100 and delegates to the _run_actor helper to call the Apify 'naver-news-scraper' actor.
@mcp.tool() async def search_naver_news( query: str, max_articles: int = 20, sort: str = "date", ) -> list[dict]: """ Search Naver News (네이버 뉴스) for Korean news articles. Args: query: Search query in Korean or English max_articles: Maximum number of articles to return (default 20, max 100) sort: Sort order — 'date' (최신순) or 'sim' (관련도순) Returns: List of article objects with title, summary, source, date, url fields. """ max_articles = min(max_articles, 100) return await _run_actor( f"{APIFY_ACCOUNT}/naver-news-scraper", {"query": query, "maxArticles": max_articles, "sort": sort}, ) - Input type definition / signature for search_naver_news: takes query (str), max_articles (int, default 20), sort (str, default 'date'), returns list[dict].
async def search_naver_news( query: str, max_articles: int = 20, sort: str = "date", ) -> list[dict]: - src/korean_data_mcp/server.py:175-175 (registration)Tool registration via @mcp.tool() decorator on the search_naver_news async function. FastMCP automatically registers the function as an MCP tool based on the decorator.
@mcp.tool() - src/korean_data_mcp/server.py:34-43 (helper)The _run_actor helper that runs an Apify actor and returns dataset items. Used by search_naver_news to call the 'naver-news-scraper' actor.
async def _run_actor(actor_id: str, input_data: dict, timeout_secs: int = 60) -> list[dict]: """Run an Apify actor synchronously and return dataset items.""" token = _get_token() url = f"{APIFY_BASE}/acts/{actor_id}/run-sync-get-dataset-items" params = {"token": token} async with httpx.AsyncClient(timeout=timeout_secs + 10) as client: resp = await client.post(url, json=input_data, params=params) resp.raise_for_status() return resp.json()