localSearch
Search for places on Naver Maps using specific queries, display up to 5 results, and sort by correctness or review count for Korean locations.
Instructions
Searches for places registered with Naver's local service.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| display | No | number of search results to display in response | |
| query | Yes | query used for search | |
| sort | No | sorting method. random: sorted by correctness. comment: sorted by a number of reviews (descending) | random |
Implementation Reference
- src/mcp_naver_maps/server.py:45-63 (handler)The MCP tool handler for 'localSearch', including registration via @mcp.tool decorator, input schema via Pydantic Fields, and logic delegating to NaverMapsClient.@mcp.tool(description="Searches for places registered with Naver's local service.") async def localSearch( query: str = Field(description="query used for search", min_length=1), display: int = Field( 5, description="number of search results to display in response", ge=0, le=5 ), sort: Literal["random", "comment"] = Field( "random", description="sorting method. random: sorted by correctness. comment: sorted by a number of reviews (descending)", ), ) -> LocalSearchResponse | Dict: """ Returns: LocalSearchResponse: An object containing places registered with Naver's local service. """ try: return await naver_maps_client.searchForLocalInformation(query, display, sort) except Exception as ex: return {"success": False, "error": str(ex)}
- src/mcp_naver_maps/models.py:36-41 (schema)Pydantic BaseModel defining the structure of the LocalSearchResponse output.class LocalSearchResponse(BaseModel): total: int = Field(description="Total number of results") start: int = Field(description="Starting index of results") display: int = Field(description="Number of results displayed in the response") items: List[LocalItem] = Field(description="List of search result items")
- Client helper method that makes the HTTP request to Naver's local search API and returns parsed LocalSearchResponse.async def searchForLocalInformation( self, query: str, display: int = 5, sort: Literal["random", "comment"] = "random" ) -> LocalSearchResponse: """ https://developers.naver.com/docs/serviceapi/search/local/local.md#%EC%A7%80%EC%97%AD """ path = f"{self.SEARCH_BASE_URL}/local.json" params = { "query": query, "display": display, "sort": sort, } response_json = await self._get(path, self.naver_headers, params) return LocalSearchResponse(**response_json)
- src/mcp_naver_maps/models.py:27-34 (schema)Pydantic BaseModel for individual items in LocalSearchResponse.class LocalItem(BaseModel): title: str = Field(description="Name of the place") link: str = Field(description="URL of the place") category: str = Field(description="Category of the place") description: str = Field(description="Brief description of the place") address: str = Field(description="Land-lot address") roadAddress: str = Field(description="Street address")