Skip to main content
Glama

calculate_stability_derivatives

Calculate longitudinal stability derivatives for aircraft wings based on wing configuration and flight conditions to analyze aerodynamic stability.

Instructions

Calculate basic longitudinal stability derivatives for a wing.

Args: wing_config: Wing configuration parameters flight_conditions: Flight conditions

Returns: JSON string with stability derivatives

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wing_configYes
flight_conditionsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary handler function for the MCP tool 'calculate_stability_derivatives'. It wraps the core implementation from integrations.aero, handles errors, and returns a formatted JSON string response.
    def calculate_stability_derivatives(wing_config: dict, flight_conditions: dict) -> str:
        """Calculate basic longitudinal stability derivatives for a wing.
    
        Args:
            wing_config: Wing configuration parameters
            flight_conditions: Flight conditions
    
        Returns:
            JSON string with stability derivatives
        """
        try:
            from ..integrations.aero import calculate_stability_derivatives as _stability
    
            result = _stability(wing_config, flight_conditions)
            return json.dumps(result, indent=2)
    
        except ImportError:
            return "Stability analysis not available - install aerodynamics packages"
        except Exception as e:
            logger.error(f"Stability analysis error: {str(e)}", exc_info=True)
            return f"Stability analysis error: {str(e)}"
  • Registration of the 'calculate_stability_derivatives' tool in the FastMCP server.
    mcp.tool(calculate_stability_derivatives)
  • Core implementation of stability derivatives calculation using simplified lifting line theory approximations, including lift curve slope (CL_alpha) and pitching moment slope (CM_alpha). Accepts WingGeometry and flight conditions.
    def calculate_stability_derivatives(
        geometry: WingGeometry, alpha_deg: float = 2.0, mach: float = 0.2
    ) -> StabilityDerivatives:
        """
        Calculate basic longitudinal stability derivatives.
    
        Args:
            geometry: Wing geometry
            alpha_deg: Reference angle of attack
            mach: Mach number
    
        Returns:
            StabilityDerivatives object
        """
        # Calculate wing area and aspect ratio
        S = geometry.span_m * (geometry.chord_root_m + geometry.chord_tip_m) / 2
        AR = geometry.span_m**2 / S
    
        # Get airfoil data
        airfoil_data = AIRFOIL_DATABASE.get(
            geometry.airfoil_root, AIRFOIL_DATABASE["NACA2412"]
        )
    
        # 3D lift curve slope
        e = 0.85  # Oswald efficiency
        beta = math.sqrt(max(0.01, 1 - mach**2))
        CL_alpha_2d = airfoil_data["cl_alpha"]
        CL_alpha = CL_alpha_2d / (1 + CL_alpha_2d / (math.pi * AR * e)) / beta
    
        # Pitching moment slope (simplified)
        # Typically negative for stable aircraft
        CM_alpha = -0.1 * CL_alpha  # Rough approximation
    
        return StabilityDerivatives(
            CL_alpha=CL_alpha,
            CM_alpha=CM_alpha,
            CL_alpha_dot=None,  # Would need unsteady analysis
            CM_alpha_dot=None,
        )
  • Pydantic schema for output stability derivatives (CL_alpha, CM_alpha, etc.).
    class StabilityDerivatives(BaseModel):
        """Longitudinal stability derivatives."""
    
        CL_alpha: float = Field(..., description="Lift curve slope (per radian)")
        CM_alpha: float = Field(..., description="Pitching moment curve slope")
        CL_alpha_dot: float | None = Field(None, description="CL due to alpha rate")
        CM_alpha_dot: float | None = Field(None, description="CM due to alpha rate")
  • Pydantic schema for input wing geometry used in stability derivatives and other aero analyses.
    class WingGeometry(BaseModel):
        """Wing planform geometry definition."""
    
        span_m: float = Field(..., gt=0, description="Wing span in meters")
        chord_root_m: float = Field(..., gt=0, description="Root chord in meters")
        chord_tip_m: float = Field(..., gt=0, description="Tip chord in meters")
        sweep_deg: float = Field(
            0.0, ge=-45, le=45, description="Quarter-chord sweep in degrees"
        )
        dihedral_deg: float = Field(
            0.0, ge=-15, le=15, description="Dihedral angle in degrees"
        )
        twist_deg: float = Field(
            0.0, ge=-10, le=10, description="Geometric twist (tip relative to root)"
        )
        airfoil_root: str = Field("NACA2412", description="Root airfoil name")
        airfoil_tip: str = Field("NACA2412", description="Tip airfoil name")
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool calculates derivatives and returns JSON, but doesn't describe computational characteristics (deterministic/stochastic), performance expectations, error conditions, or whether it's a read-only operation. The mention of 'basic' suggests simplified calculations but lacks specifics about limitations or assumptions.

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 efficiently structured with a clear purpose statement followed by Args and Returns sections. Each sentence serves a distinct purpose. However, the Args section could be more informative given the complex nested parameters, and the 'JSON string' return specification is somewhat redundant with the output schema.

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 tool's moderate complexity (2 nested object parameters), absence of annotations, but presence of an output schema, the description is partially complete. It covers the core purpose and return format, but lacks crucial details about parameter structures, computational behavior, and usage context. The output schema existence reduces but doesn't eliminate the need for more comprehensive documentation.

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

Parameters2/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 names the two parameters ('wing_config' and 'flight_conditions') but provides minimal semantic context - only that they contain 'parameters' and 'conditions' respectively. No details about required fields, units, formats, or example structures are given, leaving significant gaps in understanding what these complex objects should contain.

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 calculates 'basic longitudinal stability derivatives for a wing', specifying both the action (calculate) and the resource (stability derivatives). It distinguishes from most siblings by focusing on wing stability rather than orbital mechanics, propulsion, or other aerospace domains. However, it doesn't explicitly differentiate from 'wing_vlm_analysis' which might also analyze wing properties.

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?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention prerequisites, appropriate contexts, or when other tools like 'wing_vlm_analysis' or 'get_aircraft_performance' might be more suitable. The user must infer usage from the purpose statement alone.

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