getFlightsInArea
Query all flights within a specified geographic area using boundary box coordinates to identify available air traffic and travel options.
Instructions
区域航班查询 - 查询指定地理区域内的所有航班。参数为边界框坐标(最小纬度,最大纬度,最小经度,最大经度)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_lat | Yes | ||
| max_lon | Yes | ||
| min_lat | Yes | ||
| min_lon | Yes |
Implementation Reference
- Core handler function that constructs a bounding box from input coordinates and delegates to SimpleOpenSkyTracker.get_all_states() to fetch real-time flight data from OpenSky Network API.def getFlightsInArea(min_lat: float, max_lat: float, min_lon: float, max_lon: float) -> Dict[str, Any]: """ 查询指定地理区域内的所有航班 Args: min_lat: 最小纬度 max_lat: 最大纬度 min_lon: 最小经度 max_lon: 最大经度 Returns: 包含区域内航班列表的字典 """ bbox = (min_lat, max_lat, min_lon, max_lon) return simple_tracker.get_all_states(bbox)
- flight_ticket_mcp_server/main.py:273-278 (registration)Registration of the MCP tool using FastMCP @mcp.tool() decorator. The function signature and docstring define the tool schema, and it delegates execution to the core handler in simple_opensky_tools.py.@mcp.tool() def getFlightsInArea(min_lat: float, max_lat: float, min_lon: float, max_lon: float): """区域航班查询 - 查询指定地理区域内的所有航班。参数为边界框坐标(最小纬度,最大纬度,最小经度,最大经度)""" logger.debug(f"调用区域航班查询工具: bbox=({min_lat}, {max_lat}, {min_lon}, {max_lon})") return simple_opensky_tools.getFlightsInArea(min_lat, max_lat, min_lon, max_lon)