Skip to main content
Glama

trajectory_sensitivity_analysis

Analyze how variations in rocket parameters affect trajectory outcomes to identify critical factors and optimize flight performance.

Instructions

Perform sensitivity analysis on rocket trajectory parameters.

Args: rocket_geometry: Baseline rocket geometry parameter_variations: Parameters to vary and their ranges analysis_options: Optional analysis settings

Returns: JSON string with sensitivity analysis results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rocket_geometryYes
parameter_variationsYes
analysis_optionsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main MCP tool handler for trajectory_sensitivity_analysis. Parses input dicts into RocketGeometry, delegates to trajopt implementation, and returns JSON results or error messages.
    def trajectory_sensitivity_analysis(
        rocket_geometry: dict,
        parameter_variations: dict,
        analysis_options: dict | None = None,
    ) -> str:
        """Perform sensitivity analysis on rocket trajectory parameters.
    
        Args:
            rocket_geometry: Baseline rocket geometry
            parameter_variations: Parameters to vary and their ranges
            analysis_options: Optional analysis settings
    
        Returns:
            JSON string with sensitivity analysis results
        """
        try:
            from ..integrations.trajopt import (
                RocketGeometry,
            )
            from ..integrations.trajopt import (
                trajectory_sensitivity_analysis as _sensitivity,
            )
    
            geometry = RocketGeometry(**rocket_geometry)
    
            result = _sensitivity(geometry, parameter_variations, analysis_options or {})
    
            return json.dumps(result, indent=2)
    
        except ImportError:
            return "Sensitivity analysis not available - install optimization packages"
        except Exception as e:
            logger.error(f"Sensitivity analysis error: {str(e)}", exc_info=True)
            return f"Sensitivity analysis error: {str(e)}"
  • Import statement in fastmcp_server.py that brings the trajectory_sensitivity_analysis handler into scope for registration.
    from .tools.optimization import (
        genetic_algorithm_optimization,
        monte_carlo_uncertainty_analysis,
        optimize_thrust_profile,
        particle_swarm_optimization,
        porkchop_plot_analysis,
        trajectory_sensitivity_analysis,
    )
  • Explicit registration of the trajectory_sensitivity_analysis tool with the FastMCP server.
    mcp.tool(trajectory_sensitivity_analysis)
  • Core helper function implementing the sensitivity analysis logic by varying parameters, running simulations, and computing percent changes and sensitivities.
    def trajectory_sensitivity_analysis(
        base_geometry: RocketGeometry,
        parameter_variations: dict[str, list[float]],
        objective: str = "max_altitude",
    ) -> dict[str, Any]:
        """
        Perform sensitivity analysis on trajectory parameters.
    
        Args:
            base_geometry: Baseline rocket geometry
            parameter_variations: Dict with parameter names and variation values
            objective: Objective to analyze sensitivity for
    
        Returns:
            Sensitivity analysis results
        """
        baseline_trajectory = rocket_3dof_trajectory(base_geometry)
        baseline_performance = analyze_rocket_performance(baseline_trajectory)
    
        if objective == "max_altitude":
            baseline_value = baseline_performance.max_altitude_m
        elif objective == "max_velocity":
            baseline_value = baseline_performance.max_velocity_ms
        elif objective == "specific_impulse":
            baseline_value = baseline_performance.specific_impulse_s
        else:
            baseline_value = baseline_performance.max_altitude_m
    
        sensitivity_results = {}
    
        for param_name, variations in parameter_variations.items():
            param_results = []
    
            for variation in variations:
                # Create modified geometry
                modified_geometry = RocketGeometry(
                    dry_mass_kg=base_geometry.dry_mass_kg,
                    propellant_mass_kg=base_geometry.propellant_mass_kg,
                    diameter_m=base_geometry.diameter_m,
                    length_m=base_geometry.length_m,
                    cd=base_geometry.cd,
                    thrust_curve=base_geometry.thrust_curve,
                )
    
                # Apply variation
                if param_name == "dry_mass_kg":
                    modified_geometry.dry_mass_kg = variation
                elif param_name == "propellant_mass_kg":
                    modified_geometry.propellant_mass_kg = variation
                elif param_name == "diameter_m":
                    modified_geometry.diameter_m = variation
                elif param_name == "cd":
                    modified_geometry.cd = variation
    
                try:
                    trajectory = rocket_3dof_trajectory(modified_geometry)
                    performance = analyze_rocket_performance(trajectory)
    
                    if objective == "max_altitude":
                        current_value = performance.max_altitude_m
                    elif objective == "max_velocity":
                        current_value = performance.max_velocity_ms
                    elif objective == "specific_impulse":
                        current_value = performance.specific_impulse_s
                    else:
                        current_value = performance.max_altitude_m
    
                    # Calculate sensitivity
                    percent_change_param = (
                        (variation - getattr(base_geometry, param_name))
                        / getattr(base_geometry, param_name)
                        * 100
                    )
                    percent_change_objective = (
                        (current_value - baseline_value) / baseline_value * 100
                    )
                    sensitivity = (
                        percent_change_objective / percent_change_param
                        if percent_change_param != 0
                        else 0
                    )
    
                    param_results.append(
                        {
                            "parameter_value": variation,
                            "objective_value": current_value,
                            "percent_change_param": percent_change_param,
                            "percent_change_objective": percent_change_objective,
                            "sensitivity": sensitivity,
                        }
                    )
                except Exception:
                    param_results.append(
                        {
                            "parameter_value": variation,
                            "error": "Simulation failed",
                            "sensitivity": None,
                        }
                    )
    
            sensitivity_results[param_name] = param_results
    
        return {
            "baseline_value": baseline_value,
            "objective": objective,
            "parameter_sensitivities": sensitivity_results,
            "baseline_geometry": asdict(base_geometry),
        }
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 that the tool 'performs sensitivity analysis' but doesn't describe what that entails computationally (e.g., local vs. global methods, computational intensity, typical runtime, or side effects). It also doesn't clarify if this is a read-only analysis or has mutation effects, nor does it mention authentication needs, rate limits, or error handling. For a complex analysis tool with no annotation coverage, this is a significant gap.

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 and well-structured. It starts with a clear purpose statement, followed by bullet points for arguments and returns, making it easy to scan. There's no redundant or verbose language, and every sentence serves a functional purpose (though the content is sparse).

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 complexity (sensitivity analysis with 3 parameters including nested objects), the lack of annotations, and 0% schema description coverage, the description is incomplete. It does mention that an output schema exists ('Returns: JSON string with sensitivity analysis results'), which helps, but it doesn't compensate for the missing behavioral and parameter details. For a tool of this sophistication, more context is needed to use it effectively.

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?

The schema description coverage is 0%, meaning none of the three parameters have descriptions in the schema. The description adds minimal value: it lists parameter names ('rocket_geometry', 'parameter_variations', 'analysis_options') but doesn't explain what these mean (e.g., what fields 'rocket_geometry' should include, how 'parameter_variations' should be structured, or what 'analysis_options' control). For a tool with complex nested objects and no schema documentation, this is inadequate.

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: 'Perform sensitivity analysis on rocket trajectory parameters.' This specifies both the action ('perform sensitivity analysis') and the target resource ('rocket trajectory parameters'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'monte_carlo_uncertainty_analysis' or 'rocket_3dof_trajectory', which might also involve trajectory analysis.

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. It doesn't mention sibling tools like 'monte_carlo_uncertainty_analysis' (which might be a related uncertainty method) or 'rocket_3dof_trajectory' (which might compute baseline trajectories), nor does it specify prerequisites, constraints, or typical use cases. This leaves the agent guessing about appropriate contexts.

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