Skip to main content
Glama

airfoil_polar_analysis

Analyze airfoil performance by generating lift, drag, and moment coefficient data across angle of attack ranges for specified Reynolds and Mach numbers.

Instructions

Generate airfoil polar data (CL, CD, CM vs alpha) using database or advanced methods.

Args: airfoil_name: Airfoil name (e.g., 'NACA2412', 'NACA0012') reynolds_number: Reynolds number mach_number: Mach number alpha_range_deg: Optional angle of attack range, defaults to [-10, 20] deg

Returns: Formatted string with airfoil polar data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
airfoil_nameYes
reynolds_numberNo
mach_numberNo
alpha_range_degNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Registers the airfoil_polar_analysis tool with the FastMCP server.
    mcp.tool(airfoil_polar_analysis)
  • The primary handler function registered as the MCP tool. It calls the core analysis function, formats the polar data into a readable table, includes JSON output, and handles errors gracefully.
    def airfoil_polar_analysis(
        airfoil_name: str,
        reynolds_number: float = 1000000,
        mach_number: float = 0.1,
        alpha_range_deg: list[float] | None = None,
    ) -> str:
        """Generate airfoil polar data (CL, CD, CM vs alpha) using database or advanced methods.
    
        Args:
            airfoil_name: Airfoil name (e.g., 'NACA2412', 'NACA0012')
            reynolds_number: Reynolds number
            mach_number: Mach number
            alpha_range_deg: Optional angle of attack range, defaults to [-10, 20] deg
    
        Returns:
            Formatted string with airfoil polar data
        """
        try:
            from ..integrations.aero import airfoil_polar_analysis as _airfoil_analysis
    
            alpha_range_deg = alpha_range_deg or list(range(-10, 21, 2))
    
            result = _airfoil_analysis(
                airfoil_name, reynolds_number, mach_number, alpha_range_deg
            )
    
            # Format response
            result_lines = [f"Airfoil Polar Analysis: {airfoil_name}", "=" * 60]
            result_lines.extend(
                [
                    f"Reynolds Number: {reynolds_number:.0e}",
                    f"Mach Number: {mach_number:.3f}",
                    "",
                    f"{'Alpha (°)':>8} {'CL':>8} {'CD':>8} {'CM':>8} {'L/D':>8}",
                ]
            )
            result_lines.append("-" * 50)
    
            for point in result.get("polar_data", []):
                result_lines.append(
                    f"{point.get('alpha_deg', 0):8.1f} {point.get('cl', 0):8.4f} "
                    f"{point.get('cd', 0):8.5f} {point.get('cm', 0):8.4f} "
                    f"{point.get('cl_cd_ratio', 0):8.1f}"
                )
    
            # Add JSON data
            json_data = json.dumps(result, indent=2)
            result_lines.extend(["", "JSON Data:", json_data])
    
            return "\n".join(result_lines)
    
        except ImportError:
            return "Airfoil analysis not available - install aerodynamics packages"
        except Exception as e:
            logger.error(f"Airfoil analysis error: {str(e)}", exc_info=True)
            return f"Airfoil analysis error: {str(e)}"
  • Core implementation of airfoil polar analysis. Dispatches to AeroSandbox XFoil integration if available, otherwise uses a simplified physics-based model from the airfoil database.
    def airfoil_polar_analysis(
        airfoil_name: str,
        alpha_deg_list: list[float],
        reynolds: float = 1e6,
        mach: float = 0.1,
    ) -> list[AirfoilPoint]:
        """
        Generate airfoil polar data.
    
        Args:
            airfoil_name: Airfoil designation (e.g., "NACA2412")
            alpha_deg_list: Angles of attack to analyze
            reynolds: Reynolds number
            mach: Mach number
    
        Returns:
            List of AirfoilPoint objects with cl, cd, cm data
        """
        if AEROSANDBOX_AVAILABLE:
            try:
                return _aerosandbox_airfoil_polar(
                    airfoil_name, alpha_deg_list, reynolds, mach
                )
            except Exception:
                # Fall back to database method
                pass
    
        # Use simplified database method
        return _database_airfoil_polar(airfoil_name, alpha_deg_list, reynolds, mach)
  • Pydantic model defining the structure of individual airfoil polar data points returned by the analysis functions.
    class AirfoilPoint(BaseModel):
        """Single airfoil polar point."""
    
        alpha_deg: float = Field(..., description="Angle of attack in degrees")
        cl: float = Field(..., description="Lift coefficient")
        cd: float = Field(..., description="Drag coefficient")
        cm: float | None = Field(None, description="Moment coefficient")
        cl_cd_ratio: float = Field(..., description="Lift to drag ratio")
  • Static database of aerodynamic coefficients for common airfoils, used as fallback for polar generation when advanced libraries are unavailable.
    AIRFOIL_DATABASE = {
        "NACA0012": {
            "cl_alpha": 6.28,  # per radian
            "cl0": 0.0,  # zero-angle lift coefficient (symmetric)
            "cd0": 0.006,
            "cl_max": 1.4,
            "alpha_stall_deg": 15.0,
            "cm0": 0.0,  # symmetric airfoil
        },
        "NACA2412": {
            "cl_alpha": 6.28,
            "cl0": 0.25,  # zero-angle lift coefficient (cambered)
            "cd0": 0.007,
            "cl_max": 1.6,
            "alpha_stall_deg": 16.0,
            "cm0": -0.05,
        },
        "NACA4412": {
            "cl_alpha": 6.28,
            "cl0": 0.40,  # zero-angle lift coefficient (4% camber)
            "cd0": 0.008,
            "cl_max": 1.7,
            "alpha_stall_deg": 17.0,
            "cm0": -0.08,
        },
        "NACA6412": {
            "cl_alpha": 6.28,
            "cl0": 0.55,  # zero-angle lift coefficient (6% camber)
            "cd0": 0.007,
            "cl_max": 1.8,
            "alpha_stall_deg": 18.0,
            "cm0": -0.12,
        },
        "CLARKY": {
            "cl_alpha": 6.0,
            "cl0": 0.30,  # zero-angle lift coefficient (cambered)
            "cd0": 0.008,
            "cl_max": 1.5,
            "alpha_stall_deg": 14.0,
            "cm0": -0.06,
        },
    }
Behavior2/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 mentions 'using database or advanced methods' which hints at implementation approach, but doesn't clarify what 'advanced methods' means, whether this is a computation or lookup, potential accuracy limitations, execution time, or error conditions. For a computational tool with no annotation coverage, this is insufficient.

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 for the main description, arguments, and returns. It's appropriately sized at 4 sentences plus parameter documentation. The information is front-loaded with the core purpose stated first. The only minor inefficiency is the somewhat vague 'using database or advanced methods' phrase.

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

Completeness3/5

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

Given the computational nature of the tool, no annotations, and the existence of an output schema (implied by 'Returns' statement), the description is moderately complete. It covers the purpose and parameters well, but lacks important behavioral context about how the computation works, accuracy considerations, and when to use versus alternatives. The output schema existence reduces the need to detail return values.

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 provides explicit parameter documentation in the 'Args' section that explains what each parameter represents, including examples for 'airfoil_name' and default values for 'alpha_range_deg'. With 0% schema description coverage, this documentation is essential and adds significant value beyond the bare schema. The only minor gap is not explaining the format of 'alpha_range_deg' as a two-element array.

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: 'Generate airfoil polar data (CL, CD, CM vs alpha) using database or advanced methods.' This specifies the verb ('generate'), resource ('airfoil polar data'), and output format. However, it doesn't explicitly differentiate from sibling tools like 'get_airfoil_database' or 'wing_vlm_analysis', which might also provide aerodynamic data.

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. There are several sibling tools that might provide related aerodynamic data (e.g., 'get_airfoil_database', 'wing_vlm_analysis'), but the description doesn't mention any of them or explain when this specific polar analysis tool is appropriate versus other methods.

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