Skip to main content
Glama
jikime

Naver Search MCP Server

search_image

Find and retrieve images by keyword with customizable filters for size, sorting, and pagination. Integrated with Naver Search MCP Server for structured, AI-optimized image search results.

Instructions

Searches for images using the given keyword. The page parameter allows for page navigation and sort='sim'/'date', filter='all'/'large'/'medium'/'small' is supported.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
displayNo
filterNoall
pageNo
queryYes
sortNosim

Implementation Reference

  • The handler function implementing the core logic for the 'search_image' tool. It prepares API parameters including pagination, sorting, and filter, then delegates to the shared _make_api_call helper using the 'image.json' endpoint and ImageResult schema.
    async def search_image(query: str, display: int = 10, page: int = 1, sort: str = "sim", filter: str = "all") -> str: """ Searches for images using the given keyword. The page parameter allows for page navigation and sort='sim'/'date', filter='all'/'large'/'medium'/'small' 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). filter (str, optional): The image size filter. Default is "all" (all sizes). """ start = calculate_start(page, display) display = min(display, 100) params = {"query": query, "display": display, "start": start, "sort": sort, "filter": filter} return await _make_api_call("image.json", params, ImageResult, "Image")
  • server.py:568-571 (registration)
    MCP tool registration decorator specifying the name 'search_image' and its description.
    @mcp.tool( name="search_image", description="Searches for images using the given keyword. The page parameter allows for page navigation and sort='sim'/'date', filter='all'/'large'/'medium'/'small' is supported." )
  • Pydantic model defining the structure of individual image items in search results, including thumbnail URL and dimensions.
    class ImageItem(BaseItem): thumbnail: Optional[str] = None sizeheight: Optional[str] = None sizewidth: Optional[str] = None
  • Pydantic model for the complete image search response, inheriting from SearchResultBase and containing a list of ImageItem objects.
    class ImageResult(SearchResultBase): items: List[ImageItem]
  • Helper function used by search_image (and other tools) to compute the 'start' pagination parameter for Naver API calls.
    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