search_cafe_article
Search for Naver cafe articles using keywords, with options to navigate pages and sort by relevance or date.
Instructions
Searches for cafe articles on Naver using the given keyword. The page parameter allows for page navigation and sort='sim'/'date' is supported.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| display | No | ||
| page | No | ||
| sort | No | sim |
Implementation Reference
- server.py:458-471 (handler)The async function implementing the search_cafe_article tool logic, which calculates pagination parameters, prepares API params, and delegates the API call and response formatting to the shared _make_api_call helper.async def search_cafe_article(query: str, display: int = 10, page: int = 1, sort: str = "sim") -> str: """ Searches for cafe articles on Naver using the given keyword. The page parameter allows for page navigation and sort='sim'/'date' is supported. Args: query (str): The keyword to search for display (int, optional): The number of results to display. Default is 10. page (int, optional): The starting page number. Default is 1. sort (str, optional): The sorting criteria. Default is "sim" (similarity). """ start = calculate_start(page, display) display = min(display, 100) params = {"query": query, "display": display, "start": start, "sort": sort} return await _make_api_call("cafearticle.json", params, CafeArticleResult, "Cafe Article")
- server.py:454-457 (registration)The @mcp.tool decorator that registers the search_cafe_article tool with MCP, specifying its name and description.@mcp.tool( name="search_cafe_article", description="Searches for cafe articles on Naver using the given keyword. The page parameter allows for page navigation and sort='sim'/'date' is supported." )
- server.py:125-125 (schema)Output schema definition: Pydantic-style model for parsing the Naver Cafe Article search API response, inheriting from SearchResultBase and containing a list of CafeArticleItem objects.class CafeArticleResult(SearchResultBase): items: List[CafeArticleItem]
- server.py:58-60 (schema)Item schema for cafe articles: Extends DescriptionItem (which likely includes title, link, description) with cafe-specific fields cafename and cafeurl.class CafeArticleItem(DescriptionItem): cafename: Optional[str] = None cafeurl: Optional[str] = None