search_naver_places
Search Naver Map places by keyword and location to find cafes, restaurants, and local businesses. Supports up to 100 results for real-time data retrieval.
Instructions
Search Naver Map (네이버 지도) places by keyword.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | Yes | Place type or name, e.g. '카페', '맛집', 'cafe' | |
| location | No | Location context, e.g. '홍대', '강남역', 'Itaewon' | |
| max_places | No | Maximum number of places to return (default 20, max 100) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/korean_data_mcp/server.py:203-225 (handler)The `search_naver_places` async function is the MCP tool handler. It accepts keyword, location (optional), and max_places parameters, constructs a search query, and delegates to the Apify actor 'naver-place-search' via the _run_actor helper. The @mcp.tool() decorator registers it as a FastMCP tool.
@mcp.tool() async def search_naver_places( keyword: str, location: str = "", max_places: int = 20, ) -> list[dict]: """ Search Naver Map (네이버 지도) places by keyword. Args: keyword: Place type or name, e.g. '카페', '맛집', 'cafe' location: Location context, e.g. '홍대', '강남역', 'Itaewon' max_places: Maximum number of places to return (default 20, max 100) Returns: List of place objects with name, category, address, rating, reviewCount, url fields. """ max_places = min(max_places, 100) search_query = f"{keyword} {location}".strip() return await _run_actor( f"{APIFY_ACCOUNT}/naver-place-search", {"query": search_query, "maxPlaces": max_places}, ) - The function signature serves as the input schema: 'keyword' (str, required), 'location' (str, default ''), 'max_places' (int, default 20, max 100). The return type is list[dict], with documented fields: name, category, address, rating, reviewCount, url.
@mcp.tool() async def search_naver_places( keyword: str, location: str = "", max_places: int = 20, ) -> list[dict]: """ Search Naver Map (네이버 지도) places by keyword. Args: keyword: Place type or name, e.g. '카페', '맛집', 'cafe' location: Location context, e.g. '홍대', '강남역', 'Itaewon' max_places: Maximum number of places to return (default 20, max 100) Returns: List of place objects with name, category, address, rating, reviewCount, url fields. """ max_places = min(max_places, 100) search_query = f"{keyword} {location}".strip() return await _run_actor( f"{APIFY_ACCOUNT}/naver-place-search", {"query": search_query, "maxPlaces": max_places}, ) - src/korean_data_mcp/server.py:203-203 (registration)The tool is registered via the `@mcp.tool()` decorator on line 203, which binds the Python function to the MCP FastMCP server instance named 'korean-data-mcp'.
@mcp.tool() - src/korean_data_mcp/server.py:34-43 (helper)The `_run_actor` helper function is called by search_naver_places. It sends the input data to the Apify actor URL (using APIFY_ACCOUNT/naver-place-search) via an HTTP POST request and returns the dataset items.
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()