Skip to main content
Glama

maps_around_search

Search for points of interest within a specified radius using location coordinates and keywords to find nearby businesses, landmarks, and services.

Instructions

周边搜,根据用户传入关键词以及坐标location,搜索出radius半径范围的POI

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
locationYes
radiusNo1000
keywordsNo

Implementation Reference

  • The handler function for the 'maps_around_search' tool. It performs a POI (Point of Interest) search around a given location coordinate within a specified radius, optionally filtered by keywords, using the Amap Maps API. Returns a list of nearby POIs or an error.
    @mcp.tool() def maps_around_search(location: str, radius: str = "1000", keywords: str = "") -> Dict[str, Any]: """周边搜,根据用户传入关键词以及坐标location,搜索出radius半径范围的POI""" try: response = requests.get( "https://restapi.amap.com/v3/place/around", params={ "key": AMAP_MAPS_API_KEY, "location": location, "radius": radius, "keywords": keywords } ) response.raise_for_status() data = response.json() if data["status"] != "1": return {"error": f"Around Search failed: {data.get('info') or data.get('infocode')}"} pois = [] for poi in data.get("pois", []): pois.append({ "id": poi.get("id"), "name": poi.get("name"), "address": poi.get("address"), "typecode": poi.get("typecode") }) return {"pois": pois} except requests.exceptions.RequestException as e: return {"error": f"Request failed: {str(e)}"}
  • The @mcp.tool() decorator registers the maps_around_search function as an MCP tool, using the function name as the tool name.
    @mcp.tool()
  • Function signature defines the input schema: location (str, required), radius (str, default '1000'), keywords (str, default ''), returns Dict[str, Any]. Docstring provides description.
    def maps_around_search(location: str, radius: str = "1000", keywords: str = "") -> Dict[str, Any]:

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/sugarforever/amap-mcp-server'

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