Skip to main content
Glama

particle_swarm_optimization

Optimize spacecraft trajectories by solving complex aerospace engineering problems with particle swarm optimization algorithms.

Instructions

Optimize spacecraft trajectory using particle swarm optimization.

Args: optimization_problem: Problem definition (objective, constraints, variables) pso_parameters: Optional PSO parameters (n_particles, iterations, etc.)

Returns: JSON string with optimization results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
optimization_problemYes
pso_parametersNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler function that implements the MCP tool logic for particle_swarm_optimization. It delegates to an external trajopt implementation (which appears to be missing) or returns an error message with JSON formatting.
    def particle_swarm_optimization(
        optimization_problem: dict, pso_parameters: dict | None = None
    ) -> str:
        """Optimize spacecraft trajectory using particle swarm optimization.
    
        Args:
            optimization_problem: Problem definition (objective, constraints, variables)
            pso_parameters: Optional PSO parameters (n_particles, iterations, etc.)
    
        Returns:
            JSON string with optimization results
        """
        try:
            from ..integrations.trajopt import particle_swarm_optimization as _pso_optimize
    
            result = _pso_optimize(optimization_problem, pso_parameters or {})
    
            return json.dumps(result, indent=2)
    
        except ImportError:
            return (
                "Particle swarm optimization not available - install optimization packages"
            )
        except Exception as e:
            logger.error(f"PSO optimization error: {str(e)}", exc_info=True)
            return f"PSO optimization error: {str(e)}"
  • Registers the particle_swarm_optimization function as an MCP tool in the FastMCP server.
    mcp.tool(particle_swarm_optimization)
  • Imports the particle_swarm_optimization tool from the optimization module 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,
    )
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it states the tool performs optimization, it doesn't describe computational requirements, runtime characteristics, convergence behavior, error handling, or what constitutes valid input. For a complex optimization 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 with three sentences that each serve a purpose: stating the tool's purpose, describing parameters, and indicating return format. It uses a clear Args/Returns structure. However, the parameter descriptions could be more informative given their complexity.

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 algorithm with nested object parameters) and the presence of an output schema (which handles return value documentation), the description provides a basic but incomplete picture. It covers the core purpose and parameter names but lacks sufficient detail about input requirements, algorithm behavior, and usage context to be fully helpful.

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 schema provides no parameter documentation. The description adds minimal value: it names the parameters ('optimization_problem' and 'pso_parameters') and gives brief hints about their contents, but doesn't explain required fields, data formats, constraints, or examples. This is inadequate for two complex object parameters with no schema documentation.

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 particle swarm optimization.' It specifies the verb ('optimize'), resource ('spacecraft trajectory'), and method ('particle swarm optimization'). However, it doesn't explicitly differentiate from sibling tools like 'genetic_algorithm_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. With multiple optimization-related sibling tools (genetic_algorithm_optimization, optimize_launch_angle, optimize_thrust_profile), there's no indication of when particle swarm optimization is preferred, what problems it's suited for, or any prerequisites for use.

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