Skip to main content
Glama

genetic_algorithm_optimization

Optimize spacecraft trajectories using genetic algorithms to solve aerospace engineering problems with defined objectives and constraints.

Instructions

Optimize spacecraft trajectory using genetic algorithm.

Args: optimization_problem: Problem definition (objective, constraints, variables) ga_parameters: Optional GA parameters (population_size, generations, etc.)

Returns: JSON string with optimization results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
optimization_problemYes
ga_parametersNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function for the 'genetic_algorithm_optimization' MCP tool. It accepts an optimization problem definition and optional GA parameters, attempts to delegate to an external trajopt integration for the actual computation, and returns JSON-formatted results or error messages if unavailable or failed.
    def genetic_algorithm_optimization(
        optimization_problem: dict, ga_parameters: dict | None = None
    ) -> str:
        """Optimize spacecraft trajectory using genetic algorithm.
    
        Args:
            optimization_problem: Problem definition (objective, constraints, variables)
            ga_parameters: Optional GA parameters (population_size, generations, etc.)
    
        Returns:
            JSON string with optimization results
        """
        try:
            from ..integrations.trajopt import (
                genetic_algorithm_optimization as _ga_optimize,
            )
    
            result = _ga_optimize(optimization_problem, ga_parameters or {})
    
            return json.dumps(result, indent=2)
    
        except ImportError:
            return "Genetic algorithm optimization not available - install optimization packages"
        except Exception as e:
            logger.error(f"GA optimization error: {str(e)}", exc_info=True)
            return f"GA optimization error: {str(e)}"
  • Registers the genetic_algorithm_optimization tool with the FastMCP server using the mcp.tool decorator/function.
    mcp.tool(genetic_algorithm_optimization)
  • Imports the genetic_algorithm_optimization handler from the optimization tools module for use in the FastMCP server.
    from .tools.optimization import (
        genetic_algorithm_optimization,
        monte_carlo_uncertainty_analysis,
        optimize_thrust_profile,
        particle_swarm_optimization,
        porkchop_plot_analysis,
        trajectory_sensitivity_analysis,
    )
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 mentions 'optimize' (implying mutation/write behavior) and describes returns as 'JSON string with optimization results', but lacks critical details: required permissions, computational intensity, rate limits, whether it's deterministic, or what happens on failure. For a complex optimization tool, 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 appropriately sized and front-loaded: the first sentence states the core purpose, followed by structured Args and Returns sections. However, the Args section could be more concise by integrating details into the main description, and some sentences (like 'JSON string with optimization results') are overly terse.

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 complexity (optimization with nested objects) and no annotations, the description is minimally adequate. It covers purpose, parameters, and returns, but lacks usage guidelines, behavioral details, and parameter specifics. The presence of an output schema helps, but doesn't fully compensate for gaps in other areas.

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 lists two parameters with brief explanations: 'optimization_problem: Problem definition (objective, constraints, variables)' and 'ga_parameters: Optional GA parameters (population_size, generations, etc.)'. This adds some meaning but is vague—no format examples, required fields, or constraints. For two complex nested objects, 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: 'Optimize spacecraft trajectory using genetic algorithm.' It specifies the verb ('optimize'), resource ('spacecraft trajectory'), and method ('genetic algorithm'). However, it doesn't explicitly differentiate from sibling tools like 'particle_swarm_optimization' or 'optimize_launch_angle', which prevents a perfect score.

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 'particle_swarm_optimization' (another optimization method) or 'optimize_launch_angle' (a more specific optimization), nor does it specify prerequisites or appropriate contexts for genetic algorithm optimization.

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