Skip to main content
Glama

select_aerospace_tool

Analyze aerospace tasks to recommend appropriate tools from the Aerospace MCP server for flight planning and aviation operations.

Instructions

Help select the most appropriate aerospace-mcp tool for a given task.

Uses GPT-5-Medium to analyze the user's task and recommend the best tool(s) along with guidance on how to use them.

Args: user_task: Description of what the user wants to accomplish user_context: Additional context about the user's situation (optional)

Returns: Recommendation with tool name(s) and usage guidance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_taskYes
user_contextNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler function for the 'select_aerospace_tool' MCP tool. It uses GPT-5-Medium (via LiteLLM) to analyze the user task and context, then recommends the best aerospace-mcp tool(s) with structured guidance.
    def select_aerospace_tool(user_task: str, user_context: str = "") -> str:
        """
        Help select the most appropriate aerospace-mcp tool for a given task.
    
        Uses GPT-5-Medium to analyze the user's task and recommend the best tool(s)
        along with guidance on how to use them.
    
        Args:
            user_task: Description of what the user wants to accomplish
            user_context: Additional context about the user's situation (optional)
    
        Returns:
            Recommendation with tool name(s) and usage guidance
        """
        # Check if LLM tools are enabled
        if not LLM_TOOLS_ENABLED:
            return "Error: LLM agent tools are disabled. Set LLM_TOOLS_ENABLED=true to enable them."
    
        if "OPENAI_API_KEY" not in os.environ:
            return "Error: OPENAI_API_KEY environment variable not set. Cannot use agent tools."
    
        # Build comprehensive tool catalog for the AI
        tools_catalog = []
        for tool in AEROSPACE_TOOLS:
            tools_catalog.append(
                {
                    "name": tool.name,
                    "description": tool.description,
                    "parameters": tool.parameters,
                    "examples": tool.examples,
                }
            )
    
        system_prompt = f"""You are an aerospace engineering assistant specialized in helping users select the right tools for their aerospace calculations and analysis tasks.
    
    Available Aerospace Tools:
    {json.dumps(tools_catalog, indent=2)}
    
    User Task: {user_task}
    User Context: {user_context}
    
    Your job is to:
    1. Analyze the user's task and context
    2. Recommend the most appropriate tool(s) from the available aerospace tools
    3. Provide clear guidance on how to use the recommended tool(s)
    4. If multiple tools are needed, explain the workflow and order of operations
    5. Highlight any prerequisites, limitations, or important considerations
    
    Respond in a clear, structured format with:
    - PRIMARY_TOOL: The main tool to use
    - SECONDARY_TOOLS: Any additional tools needed (if applicable)
    - WORKFLOW: Step-by-step guidance
    - CONSIDERATIONS: Important notes, limitations, or prerequisites
    - EXAMPLE: A concrete example of how to use the tool(s) for this task
    
    If the user's task cannot be accomplished with the available tools, clearly explain what's missing and suggest alternatives."""
    
        try:
            # Call GPT-5-Medium via LiteLLM
            response = litellm.completion(
                model="gpt-5-medium",
                messages=[
                    {"role": "system", "content": system_prompt},
                    {
                        "role": "user",
                        "content": f"Help me with this task: {user_task}\n\nContext: {user_context}",
                    },
                ],
                temperature=0.2,
                max_tokens=1500,
            )
    
            return response.choices[0].message.content.strip()
    
        except Exception as e:
            return f"Error: Failed to select appropriate tool: {str(e)}"
  • Registration of the select_aerospace_tool handler as an MCP tool in the FastMCP server.
    mcp.tool(select_aerospace_tool)
  • List of all available aerospace-mcp tools with their schemas (parameters and examples), used by select_aerospace_tool to build the tool catalog for LLM prompting.
    AEROSPACE_TOOLS = [
        ToolReference(
            name="search_airports",
            description="Search for airports by IATA code or city name",
            parameters={
                "query": "str - IATA code (e.g., 'SJC') or city name (e.g., 'San Jose')",
                "country": "str | None - Optional ISO country code filter (e.g., 'US', 'JP')",
                "query_type": "Literal['iata', 'city', 'auto'] - Type of query, defaults to 'auto'",
            },
            examples=[
                'search_airports("SFO")',
                'search_airports("London", "GB")',
                'search_airports("Tokyo")',
            ],
        ),
        ToolReference(
            name="plan_flight",
            description="Generate complete flight plan between airports",
            parameters={
                "departure": "dict - Airport info with city, iata (optional), country (optional)",
                "arrival": "dict - Airport info with city, iata (optional), country (optional)",
                "aircraft": "dict - Aircraft config with type, cruise_alt_ft, mass_kg (optional)",
                "route_options": "dict - Route config with step_km (optional, default 25.0)",
            },
            examples=[
                'plan_flight({"city": "San Francisco"}, {"city": "New York"}, {"type": "A320", "cruise_alt_ft": 37000}, {})',
                'plan_flight({"city": "London", "iata": "LHR"}, {"city": "Dubai", "iata": "DXB"}, {"type": "B777", "cruise_alt_ft": 39000, "mass_kg": 220000}, {"step_km": 50.0})',
            ],
        ),
        ToolReference(
            name="calculate_distance",
            description="Calculate great-circle distance between airports",
            parameters={
                "origin": "dict - Origin airport with city and optional iata/country",
                "destination": "dict - Destination airport with city and optional iata/country",
                "step_km": "float - Optional step size for route polyline generation (default 25.0)",
            },
            examples=[
                'calculate_distance({"city": "New York"}, {"city": "Los Angeles"})',
                'calculate_distance({"city": "Paris", "iata": "CDG"}, {"city": "Tokyo", "iata": "NRT"}, 100.0)',
            ],
        ),
        ToolReference(
            name="get_aircraft_performance",
            description="Get performance estimates for aircraft",
            parameters={
                "aircraft_type": "str - Aircraft type code (e.g., 'A320', 'B737', 'B777')",
                "distance_km": "float - Flight distance in kilometers",
                "cruise_altitude_ft": "float - Cruise altitude in feet (optional, default 35000)",
                "mass_kg": "float - Aircraft mass in kg (optional, uses 85% MTOW if not provided)",
            },
            examples=[
                'get_aircraft_performance("A320", 2500.0, 37000)',
                'get_aircraft_performance("B777", 5500.0, 39000, 250000)',
            ],
        ),
        ToolReference(
            name="get_atmosphere_profile",
            description="Calculate atmospheric conditions at various altitudes",
            parameters={
                "altitudes_m": "List[float] - List of altitudes in meters",
                "model_type": "Literal['isa', 'enhanced'] - Atmospheric model type (default 'isa')",
            },
            examples=[
                "get_atmosphere_profile([0, 1000, 5000, 10000])",
                'get_atmosphere_profile([0, 2000, 4000, 6000, 8000, 10000], "enhanced")',
            ],
        ),
        ToolReference(
            name="wind_model_simple",
            description="Calculate wind profiles at various altitudes",
            parameters={
                "altitudes_m": "List[float] - List of altitudes in meters",
                "surface_wind_mps": "float - Surface wind speed in m/s",
                "model": "Literal['logarithmic', 'power_law'] - Wind profile model (default 'logarithmic')",
                "surface_roughness_m": "float - Surface roughness in meters (default 0.1)",
            },
            examples=[
                "wind_model_simple([0, 100, 500, 1000], 10.0)",
                'wind_model_simple([0, 200, 1000, 3000], 15.0, "power_law", 0.05)',
            ],
        ),
        ToolReference(
            name="elements_to_state_vector",
            description="Convert orbital elements to state vector",
            parameters={
                "elements": "dict - Orbital elements with semi_major_axis_m, eccentricity, inclination_deg, raan_deg, arg_periapsis_deg, true_anomaly_deg, epoch_utc"
            },
            examples=[
                'elements_to_state_vector({"semi_major_axis_m": 6793000, "eccentricity": 0.001, "inclination_deg": 51.6, "raan_deg": 0.0, "arg_periapsis_deg": 0.0, "true_anomaly_deg": 0.0, "epoch_utc": "2024-01-01T12:00:00"})'
            ],
        ),
        ToolReference(
            name="propagate_orbit_j2",
            description="Propagate satellite orbit with J2 perturbations",
            parameters={
                "initial_state": "dict - Initial orbital elements or state vector",
                "time_span_s": "float - Propagation time span in seconds",
                "time_step_s": "float - Time step for propagation in seconds (default 300)",
            },
            examples=[
                'propagate_orbit_j2({"semi_major_axis_m": 6793000, "eccentricity": 0.001, "inclination_deg": 51.6, "raan_deg": 0.0, "arg_periapsis_deg": 0.0, "true_anomaly_deg": 0.0, "epoch_utc": "2024-01-01T12:00:00"}, 86400, 600)'
            ],
        ),
        ToolReference(
            name="hohmann_transfer",
            description="Calculate Hohmann transfer orbit between two circular orbits",
            parameters={
                "r1_m": "float - Initial orbit radius in meters",
                "r2_m": "float - Final orbit radius in meters",
            },
            examples=[
                "hohmann_transfer(6778000, 42164000)",  # LEO to GEO
                "hohmann_transfer(6578000, 6793000)",  # Lower LEO to ISS altitude
            ],
        ),
        ToolReference(
            name="rocket_3dof_trajectory",
            description="Simulate 3DOF rocket trajectory with atmospheric effects",
            parameters={
                "geometry": "dict - Rocket geometry with mass_kg, thrust_n, burn_time_s, drag_coeff, reference_area_m2",
                "dt_s": "float - Time step in seconds (default 0.1)",
                "max_time_s": "float - Maximum simulation time in seconds (default 300)",
                "launch_angle_deg": "float - Launch angle in degrees from vertical (default 0)",
            },
            examples=[
                'rocket_3dof_trajectory({"mass_kg": 500, "thrust_n": 8000, "burn_time_s": 60, "drag_coeff": 0.3, "reference_area_m2": 0.5}, 0.1, 300, 15)'
            ],
        ),
    ]
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals the tool uses 'GPT-5-Medium to analyze' and provides 'recommendation with tool name(s) and usage guidance,' which gives some behavioral context. However, it doesn't disclose important traits like whether this is a read-only operation, potential rate limits, authentication requirements, or error behavior. For a tool with no annotation coverage, this represents moderate but incomplete transparency.

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 well-structured with clear sections: purpose statement, implementation detail, parameters explanation, and return value description. It's appropriately sized for its function. The only minor inefficiency is the repetition between 'Help select...' and 'Uses GPT-5-Medium to analyze...' which could be slightly more concise, but overall it's front-loaded and every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (AI-based recommendation system), no annotations, and the existence of an output schema (which handles return value documentation), the description provides good contextual completeness. It explains the tool's purpose, when to use it, parameters, and what it returns. The main gap is lack of behavioral details like rate limits or error handling, but with an output schema covering return values, this is reasonably complete for the agent's needs.

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

Parameters4/5

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

The description includes an 'Args' section that explains both parameters: 'user_task: Description of what the user wants to accomplish' and 'user_context: Additional context about the user's situation (optional).' With 0% schema description coverage (schema has only titles, no descriptions), this parameter documentation in the description is essential and provides good semantic meaning beyond the bare schema. It clearly explains what each parameter represents and which is optional.

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

Purpose5/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: 'Help select the most appropriate aerospace-mcp tool for a given task' and specifies it 'Uses GPT-5-Medium to analyze the user's task and recommend the best tool(s) along with guidance on how to use them.' This is a specific verb ('select'/'recommend') with a clear resource ('aerospace-mcp tool'), and it distinguishes itself from all sibling tools which perform actual aerospace calculations rather than tool selection.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidance: it should be used 'for a given task' to 'recommend the best tool(s) along with guidance on how to use them.' This clearly indicates when to use this tool (when unsure which aerospace tool to select) versus using the sibling tools directly (when you already know which calculation to perform). The context of having 30+ sibling aerospace tools makes this guidance particularly valuable.

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/cheesejaguar/aerospace-mcp'

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