Skip to main content
Glama
yunkee-lee

MCP Kakao Local

by yunkee-lee

search_by_keyword

Find places in Korea using keywords, with options to filter by category, location radius, and pagination for precise search results.

Instructions

Searches for places related to the keyword

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYeskeyword used to search for places
category_group_codeNocategory used for filtering results (CategoryGroupCode resource)
center_coordinateNolongitude and latitude of a center
radius_from_centerNosearch radius from the center in meters
pageNopage number of result

Implementation Reference

  • MCP tool handler for 'search_by_keyword'. Defines input schema with Pydantic Fields, performs validation assertions, calls the KakaoLocalClient helper, and handles exceptions. This is the primary execution logic for the tool.
    @mcp.tool(description="Searches for places related to the keyword")
    async def search_by_keyword(
      keyword: str = Field(description="keyword used to search for places", min_length=1),
      category_group_code: CategoryGroupCode | None = Field(
        None, description="category used for filtering results (CategoryGroupCode resource)"
      ),
      center_coordinate: Coordinate | None = Field(
        None, description="longitude and latitude of a center"
      ),
      radius_from_center: int | None = Field(
        None, 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.
      """
      if center_coordinate:
        assert radius_from_center is not None
      if radius_from_center:
        assert center_coordinate is not None
    
      try:
        return await kakao_local_client.search_by_keyword(
          keyword,
          category_group_code,
          center_coordinate,
          radius_from_center,
          page=page,
        )
      except Exception as ex:
        return {"success": False, "error": str(ex)}
  • Helper function in KakaoLocalClient that constructs the API request parameters and makes the HTTP GET request to Kakao's /search/keyword endpoint, then parses the response into LocationSearchResponse.
    async def search_by_keyword(
      self,
      keyword: str,
      category_group_code: CategoryGroupCode | None,
      center: Coordinate | None,
      radius: int | None,
      page: int = 1,
      size: int = 10,
      sort_option: LocationSortOption = LocationSortOption.ACCURACY,
    ) -> LocationSearchResponse:
      """https://developers.kakao.com/docs/latest/ko/local/dev-guide#search-by-keyword"""
      path = f"{self.BASE_URL}/search/keyword"
      params = {
        "query": keyword,
        "category_group_code": category_group_code.name if category_group_code else None,
        "x": center.longitude if center else None,
        "y": center.latitude if center else None,
        "radius": radius if radius else None,
        "page": page,
        "size": size,
        "sort": sort_option.value,
      }
      response_json = await self._get(path, {k: v for k, v in params.items() if v is not None})
      return LocationSearchResponse(**response_json)
  • Pydantic model defining the output schema for the search_by_keyword tool response, including metadata and list of place documents.
    class LocationSearchResponse(BaseModel):
      meta: Meta = Field(description="Response metadata")
      documents: list[PlaceDocument] = Field(description="List of places")
  • Pydantic model for coordinate input used in search_by_keyword tool parameters.
    class Coordinate(BaseModel):
      longitude: str
      latitude: str
  • Enum defining valid category_group_code values used as input parameter type in search_by_keyword tool.
    class CategoryGroupCode(Enum):
      MT1 = "대형마트 (Large Mart, Grocery Store)"
      CS2 = "편의점 (Convenience Store)"
      PS3 = "어린이집, 유치원 (Daycare, Kindergarten)"
      SC4 = "학교 (School)"
      AC5 = "학원 (Academy/Private Institute)"
      PK6 = "주차장 (Parking Lot)"
      OL7 = "주유소, 충전소 (Gas Station, Charging Station)"
      SW8 = "지하철역 (Subway Station)"
      BK9 = "은행 (Bank)"
      CT1 = "문화시설 (Cultural Facility)"
      AG2 = "중개업소 (Agency, e.g. Real Estate)"
      PO3 = "공공기관 (Public Institution)"
      AT4 = "관광명소 (Tourist Attraction)"
      AD5 = "숙박 (Accommodation)"
      FD6 = "음식점 (Restaurant)"
      CE7 = "카페 (Cafe)"
      HP8 = "병원 (Hospital)"
      PM9 = "약국 (Pharmacy)"
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure but offers none. It doesn't mention whether this is a read-only operation, what permissions might be required, rate limits, pagination behavior (despite having a 'page' parameter), or what the search results might look like. This leaves the agent with critical gaps in understanding how the tool behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's appropriately sized for a search tool and front-loads the core functionality. Every word earns its place by conveying the essential action and target.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (5 parameters, no annotations, no output schema), the description is incomplete. It doesn't address behavioral aspects, result format, or usage context. For a search tool with multiple filtering options and pagination, more guidance is needed to help the agent use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional meaning beyond implying the 'keyword' parameter is central. It doesn't explain parameter interactions, default behaviors, or practical usage examples, so it meets the baseline but doesn't enhance understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Searches for places related to the keyword' clearly states the verb ('searches') and resource ('places'), but it's vague about scope and doesn't distinguish from sibling tools like 'search_by_category' or 'find_coordinates'. It specifies the search is keyword-based, which helps differentiate from category-based search, but doesn't explain how it differs from coordinate-based finding.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'search_by_category' or 'find_coordinates'. There's no mention of prerequisites, typical use cases, or comparative advantages. The agent must infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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