Skip to main content
Glama
aixi134

mcp-meituan-ip

get-latlng

Convert latitude and longitude coordinates into detailed location information using this tool, ideal for pinpointing precise addresses or geographic data.

Instructions

根据经纬度获取详细位置信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
latYes
lngYes

Implementation Reference

  • Core handler function that executes the get-latlng tool logic: queries Meituan API with lat/lng and returns structured CityDetailData.
    def get_latlng(lat: str, lng: str) -> CityDetailData:
        api_url = f'https://apimobile.meituan.com/group/v1/city/latlng/{lat},{lng}'
        params = {
            "tag": 0
        }
        response = requests.get(api_url, params=params)
    
        response.raise_for_status()  # 检查请求是否成功(4xx/5xx 会抛出异常)
    
        data = response.json()["data"]  # 解析 JSON
    
    
    
        # 构建 CityDetailData 对象
        location = CityDetailData(
            detail= data["detail"],
            parentArea= data["parentArea"],
            cityPinyin= data["cityPinyin"],
            lng= data["lng"],
            isForeign= data["isForeign"],
            dpCityId= data["dpCityId"],
            country= data["country"],
            isOpen= data["isOpen"],
            city= data["city"],
            id= data["id"],
            openCityName= data["openCityName"],
            originCityID= data["originCityID"],
            area= data["area"],
            areaName= data["areaName"],
            province= data["province"],
            district= data["district"],
            lat= data["lat"]
        )
    
        return location
  • Registers the get-latlng tool with MCP server including name, description, and JSON input schema.
    types.Tool(
        name="get-latlng",
        description="根据经纬度获取详细位置信息",
        inputSchema={
            "type": "object",
            "properties": {
                "lat": {"type": "string"},
                "lng": {"type": "string"},
            },
            "required": ["lat", "lng"],
        },
    )
  • Tool dispatch handler case that validates arguments, calls get_latlng function, and formats response.
    case 'get-latlng':
        if not all(
                k in arguments
                for k in ["lat", "lng"]
        ):
            raise ValueError("Missing required arguments")
        result = get_latlng(lat= arguments['lat'], lng= arguments['lng'])
        # 转换为字典后序列化
        location_dict = asdict(result)
        # Notify clients that resources have changed
        await server.request_context.session.send_resource_list_changed()
  • Pydantic-style dataclass defining the output schema/structure for get-latlng response.
    class CityDetailData:
        detail: str
        parentArea: int
        cityPinyin: str
        lng: float
        isForeign: bool
        dpCityId: int
        country: str
        isOpen: bool
        city: str
        id: int
        openCityName: str
        originCityID: int
        area: int
        areaName: str
        province: str
        district: str
        lat: float
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves '详细位置信息' (detailed location information), implying a read-only operation, but doesn't specify what 'detailed' includes (e.g., address, city, country), whether there are rate limits, authentication needs, error handling, or data freshness. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior and constraints.

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: '根据经纬度获取详细位置信息'. It's front-loaded with the core purpose, has zero redundant words, and appropriately sized for a simple tool. Every part of the sentence contributes directly to understanding the tool's function.

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 tool's complexity (2 parameters, no output schema, no annotations), the description is incomplete. It lacks details on return values (what 'detailed location information' entails), error cases, usage boundaries compared to siblings, and parameter specifics. Without annotations or output schema, the description should provide more context to enable correct tool invocation and result interpretation.

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

Parameters2/5

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

The input schema has 2 parameters (lat, lng) with 0% description coverage, meaning the schema provides no semantic context. The description mentions '经纬度' (latitude and longitude), which maps to the parameters, but adds minimal value beyond naming them. It doesn't explain format (e.g., decimal degrees, strings), units, range, or examples, failing to compensate for the low schema coverage.

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

Purpose4/5

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

The description clearly states the tool's purpose: '根据经纬度获取详细位置信息' (Get detailed location information based on latitude and longitude). It specifies the verb '获取' (get) and resource '详细位置信息' (detailed location information), making the action and target explicit. However, it doesn't differentiate from the sibling tool 'get-ip-loc', which appears to serve a similar purpose but uses IP instead of coordinates.

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. It doesn't mention the sibling tool 'get-ip-loc' or explain scenarios where latitude/longitude input is preferred over IP-based location lookup. There's no context about prerequisites, exclusions, or comparative use cases, leaving the agent to infer usage based on parameter differences 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

Related 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/aixi134/mcp-meituan-ip'

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