Skip to main content
Glama
xiaonieli7

Flight Ticket MCP Server

by xiaonieli7

trackMultipleFlights

Monitor real-time status of multiple flights simultaneously by providing flight numbers, enabling efficient tracking of departures, arrivals, and delays.

Instructions

批量航班跟踪 - 同时查询多个航班的实时状态。flight_numbers为航班呼号列表,如['CCA1234','CSN5678']

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateNo
flight_numbersYes

Implementation Reference

  • MCP tool handler for 'trackMultipleFlights', decorated with @mcp.tool() for automatic registration. Logs the invocation and delegates execution to the core helper function in simple_opensky_tools.
    @mcp.tool()
    def trackMultipleFlights(flight_numbers: list, date: str = None):
        """批量航班跟踪 - 同时查询多个航班的实时状态。flight_numbers为航班呼号列表,如['CCA1234','CSN5678']"""
        logger.debug(f"调用批量航班跟踪工具: flight_numbers={flight_numbers}, date={date}")
        return simple_opensky_tools.trackMultipleFlights(flight_numbers, date)
  • Core helper function implementing the tracking logic: loops through each flight number, retrieves status via getFlightStatus, applies rate limiting, aggregates results into a structured dictionary with success metrics.
    def trackMultipleFlights(flight_numbers: List[str], date: str = None) -> Dict[str, Any]:
        """
        批量跟踪多个航班状态
        
        Args:
            flight_numbers: 航班号列表
            date: 日期参数(OpenSky仅支持实时数据)
            
        Returns:
            包含所有航班状态的字典
        """
        if date:
            logger.info("OpenSky仅支持实时数据,忽略date参数")
        
        logger.info(f"批量查询航班状态: {flight_numbers}")
        
        results = []
        for flight_number in flight_numbers:
            result = getFlightStatus(flight_number)
            results.append(result)
            time.sleep(1)  # 避免API频率限制
        
        successful_count = sum(1 for r in results if r.get("status") == "success" and r.get("flight_count", 0) > 0)
        
        return {
            "status": "success",
            "message": f"批量查询完成,共查询{len(flight_numbers)}个航班,找到{successful_count}个",
            "flight_count": len(flight_numbers),
            "found_count": successful_count,
            "results": results,
            "query_time": datetime.now().isoformat(),
            "data_source": "opensky_network_rest",
            "note": "OpenSky仅提供实时数据,无法查询历史航班信息"
        }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It mentions '实时状态' (real-time status) which implies live data retrieval, but doesn't address critical aspects like rate limits, authentication needs, data freshness, error handling, or whether this is a read-only operation. For a tool with no annotations, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with two sentences: one stating the purpose and one explaining the key parameter. There's no wasted text, and the example is helpful. It could be slightly improved by front-loading the purpose more clearly, but overall it's efficient.

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 no annotations, no output schema, and 0% schema description coverage, the description is incomplete. It covers the basic purpose and one parameter but misses the optional 'date' parameter, behavioral traits (rate limits, auth, etc.), and output format. For a tool with 2 parameters and real-time data implications, this leaves too many gaps for effective agent use.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate. It explains 'flight_numbers' as a list of flight call signs with an example ['CCA1234','CSN5678'], which adds meaningful context beyond the bare schema. However, it doesn't mention the optional 'date' parameter at all, leaving half the parameters undocumented. The description provides partial but incomplete parameter semantics.

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: '批量航班跟踪 - 同时查询多个航班的实时状态' (Batch flight tracking - query real-time status of multiple flights simultaneously). It specifies the verb (query/track), resource (flights), and scope (multiple/batch). However, it doesn't explicitly differentiate from siblings like 'getFlightStatus' which might handle single flights.

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. With siblings like 'getFlightStatus' (likely for single flights) and 'getAirportFlights' (airport-specific), there's clear potential for overlap, but the description offers no explicit when/when-not instructions or alternative recommendations.

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

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