Skip to main content
Glama
yunkee-lee
by yunkee-lee

search_by_category

Find nearby places by category within a specified radius from a central location using Kakao Local API. Filter results for restaurants, cafes, hospitals, schools, parking lots, and other location types in Korea.

Instructions

Searches for places with matching category group code

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
category_group_codeYescategory used to search for places (CategoryGroupCode resource)
center_coordinateYeslongitude and latitude of a center
radius_from_centerYessearch radius from the center in meters
pageNopage number of result

Implementation Reference

  • MCP tool handler and registration for 'search_by_category'. Includes input schema via Pydantic Fields (category_group_code, center_coordinate, radius_from_center, page) and executes by calling the client helper, with error handling.
    @mcp.tool(description="Searches for places with matching category group code") async def search_by_category( category_group_code: CategoryGroupCode = Field( description="category used to search for places (CategoryGroupCode resource)" ), center_coordinate: Coordinate = Field(description="longitude and latitude of a center"), radius_from_center: int = Field(description="search radius from the center in meters", gt=0), page: int = Field(1, description="page number of result", ge=1), ) -> LocationSearchResponse: """ Returns: LocationSearchResponse: An object containing metadata and a list of places. """ try: return await kakao_local_client.search_by_category( category_group_code, center_coordinate, radius_from_center, page=page, ) except Exception as ex: return {"success": False, "error": str(ex)}
  • Core helper function in KakaoLocalClient that performs the actual API call to Kakao's /search/category endpoint using httpx, constructs parameters, and parses response into LocationSearchResponse model.
    async def search_by_category( self, category_group_code: CategoryGroupCode, center: Coordinate, radius: int, page: int = 1, size: int = 10, sort_option: LocationSortOption = LocationSortOption.ACCURACY, ) -> LocationSearchResponse: """https://developers.kakao.com/docs/latest/ko/local/dev-guide#search-by-category""" path = f"{self.BASE_URL}/search/category" params = { "category_group_code": category_group_code.name, "x": center.longitude, "y": center.latitude, "radius": radius, "page": page, "size": size, "sort": sort_option.value, } response_json = await self._get(path, params) return LocationSearchResponse(**response_json)

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/yunkee-lee/mcp-kakao-local'

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