search_image
Search for images using keywords with options to filter by size, sort by relevance or date, and navigate through result pages.
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
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| display | No | ||
| page | No | ||
| sort | No | sim | |
| filter | No | all |
Implementation Reference
- server.py:572-587 (handler)The asynchronous handler function that executes the core logic of the 'search_image' tool by preparing parameters and calling the image search API endpoint.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:567-571 (registration)The @mcp.tool decorator registration that defines the tool name, description, and implicitly the input schema via the function signature.# 12. 이미지 검색 @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." )