get_aircraft_performance
Calculate aircraft performance metrics for specific types, including fuel consumption and flight dynamics, based on route distance, cruise altitude, and mass. Supports accurate flight planning and optimization.
Instructions
Get performance estimates for an aircraft type (requires OpenAP)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| aircraft_type | Yes | ICAO aircraft type code (e.g., 'A320', 'B738') | |
| cruise_altitude | No | Cruise altitude in feet | |
| distance_km | Yes | Route distance in kilometers | |
| mass_kg | No | Aircraft mass in kg (optional) |
Implementation Reference
- aerospace_mcp/tools/core.py:253-276 (handler)Main handler function for the get_aircraft_performance tool. It validates OpenAP availability, calls estimates_openap for performance data, and returns formatted JSON or error messages.def get_aircraft_performance( aircraft_type: str, distance_km: float, cruise_altitude_ft: float = 35000 ) -> str: """Get performance estimates for an aircraft type (requires OpenAP). Args: aircraft_type: ICAO aircraft type code (e.g., 'A320', 'B737') distance_km: Flight distance in kilometers cruise_altitude_ft: Cruise altitude in feet Returns: JSON string with performance estimates or error message """ if not OPENAP_AVAILABLE: return "OpenAP library is not available. Install with: pip install openap" try: performance = estimates_openap(aircraft_type, distance_km, cruise_altitude_ft) return json.dumps(performance, indent=2) except OpenAPError as e: return f"Performance estimation error: {str(e)}" except Exception as e: return f"Unexpected error: {str(e)}"
- aerospace_mcp/fastmcp_server.py:87-87 (registration)Registers the get_aircraft_performance function as an MCP tool using FastMCP.mcp.tool(get_aircraft_performance)
- aerospace_mcp/fastmcp_server.py:36-42 (registration)Imports the get_aircraft_performance function from tools.core for use in the server.from .tools.core import ( calculate_distance, get_aircraft_performance, get_system_status, plan_flight, search_airports, )