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

geocode

Convert addresses into geographic coordinates using Naver Maps data for Korean locations, supporting both Korean and English language responses.

Instructions

Searches for address information related to the entered address.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesaddress to search for
languageNolanguage used in responsekor

Implementation Reference

  • The MCP tool handler for 'geocode'. Decorated with @mcp.tool for registration. Defines input schema using Pydantic Field annotations on parameters. Implements tool logic by delegating to NaverMapsClient.geocode and handling exceptions with error dict.
    @mcp.tool(description="Searches for address information related to the entered address.") async def geocode( address: str = Field(description="address to search for", min_length=1), language: Literal["kor", "eng"] = Field("kor", description="language used in response"), ) -> GeocodeResponse | Dict: """ Returns: GeocodeResponse: An object containing metadata and a list of matching addresses """ try: return await naver_maps_client.geocode(address, language) except Exception as ex: return {"success": False, "error": str(ex)}
  • Pydantic model defining the output schema for the geocode tool response, including metadata, list of addresses, status, and error handling.
    class GeocodeResponse(BaseModel): status: str = Field(description="Status of the request") meta: Meta = Field(description="Metadata of the response") addresses: List[Address] = Field(description="List of matching addresses") errorMessage: str = Field(description="Error message (only present for HTTP 500 errors)")
  • Helper function in NaverMapsClient class that executes the actual Naver Maps Geocode API call, including parameter construction, HTTP request via _get, and response parsing into GeocodeResponse model.
    async def geocode( self, query: str, language: str, page: int = 1, count: int = 10, ) -> GeocodeResponse: """ https://api.ncloud-docs.com/docs/application-maps-geocoding """ path = f"{self.MAP_BASE_URL}/map-geocode/v2/geocode" params = { "query": query, "language": language, "page": page, "count": count, } response_json = await self._get(path, self.naver_maps_headers, params) return GeocodeResponse(**response_json)
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-naver-maps'

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