find_coordinates
Locate geographical coordinates using an address with the MCP Kakao Local server. Input an address to retrieve precise latitude and longitude data for mapping purposes.
Instructions
Find coordinates of a given address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | address to search for | |
| page | No | page number of result |
Implementation Reference
- src/mcp_kakao_local/server.py:46-62 (handler)MCP tool handler function for 'find_coordinates'. It defines the input schema using Pydantic Field, calls the KakaoLocalClient helper, handles errors, and returns AddressResponse or an error dictionary. The @mcp.tool decorator registers it.@mcp.tool(description="Find coordinates of a given address") async def find_coordinates( address: str = Field(description="address to search for", min_length=1), page: int = Field(1, description="page number of result", ge=1), ) -> AddressResponse: """ Returns: AddressResponse: An object containing metadata and a list of addresses """ try: response = await kakao_local_client.find_coordinates(address, page=page) if len(response.documents) == 0: return {"success": False, "error": "No coordinates found. Check if the address is correct."} return response except Exception as ex: return {"success": False, "error": str(ex)}
- Low-level helper in KakaoLocalClient that makes the HTTP GET request to Kakao Local API endpoint for address-to-coordinate conversion and parses the response into AddressResponse.async def find_coordinates(self, address: str, page: int = 1, size: int = 10) -> AddressResponse: """https://developers.kakao.com/docs/latest/ko/local/dev-guide#address-coord""" path = f"{self.BASE_URL}/search/address" params = { "query": address, "page": page, "size": size, } response_json = await self._get(path, params) return AddressResponse(**response_json)
- src/mcp_kakao_local/models.py:92-94 (schema)Pydantic schema/model for the output of find_coordinates tool, defining the structure of the response with metadata and list of address documents containing coordinates.class AddressResponse(BaseModel): meta: Meta = Field(description="Response metadata") documents: list[AddressDocument] = Field(description="List of addresses")
- src/mcp_kakao_local/models.py:76-85 (schema)Pydantic schema for individual address documents in the find_coordinates response, including address details and x/y coordinates.class AddressDocument(BaseModel): address_name: str = Field(description="street address or land-lot address (지번 주소)") address_type: Literal["REGION", "ROAD", "REGION_ADDR", "ROAD_ADDR"] = Field( description="type of address" ) x: str = Field(description="longitude") y: str = Field(description="latitude") address: dict = Field(description="details of land-lot address (지번 주소)") road_address: dict = Field(description="details of street address")
- src/mcp_kakao_local/models.py:47-56 (schema)Pydantic schema for metadata in responses, including pagination info used in find_coordinates output.class Meta(BaseModel): total_count: int = Field(description="Number of documents found for the search results", ge=0) pageable_count: int = Field(description="Number of documents allowed in a page", ge=0, le=45) is_end: bool = Field( description="Whether the current page is the last page. If false, increase the page value in the next request to fetch the next page" ) same_name: SameName | None = Field( None, description="Region and keyword analysis information of the query" )