Skip to main content
Glama
jikime

Naver Search MCP Server

search_cafe_article

Find relevant cafe articles on Naver by entering a keyword. Customize results with display count, page navigation, and sorting by relevance or date for targeted search.

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
NameRequiredDescriptionDefault
displayNo
pageNo
queryYes
sortNosim

Implementation Reference

  • The main handler function implementing the search_cafe_article tool. It handles pagination, parameter limits, and delegates to the shared _make_api_call helper to fetch and format Naver cafe article search results.
    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)
    MCP tool registration decorator defining the tool name, description, and associating it with the handler function.
    @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." )
  • Pydantic model defining the structure of individual cafe article items in search results, extending DescriptionItem with cafe-specific fields.
    class CafeArticleItem(DescriptionItem): cafename: Optional[str] = None cafeurl: Optional[str] = None
  • Pydantic model for the overall cafe article search response, specifying items as a list of CafeArticleItem.
    class CafeArticleResult(SearchResultBase): items: List[CafeArticleItem]
  • Helper function to compute the 'start' parameter for paginated Naver API calls, respecting API limits.
    def calculate_start(page: int, display: int) -> int: """Calculates the start value for the API call based on the page number and display count.""" if page < 1: page = 1 start = (page - 1) * display + 1 # 네이버 API의 start 최대값(1000) 제한 고려 return min(start, 1000)

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jikime/py-mcp-naver-search'

If you have feedback or need assistance with the MCP directory API, please join our Discord server