Skip to main content
Glama
xiaonieli7

Flight Ticket MCP Server

by xiaonieli7

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
NameRequiredDescriptionDefault
max_latYes
max_lonYes
min_latYes
min_lonYes

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)
  • 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)

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/xiaonieli7/FlightTicketMCP'

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