Skip to main content
Glama
RadiumGu
by RadiumGu

start_experiment

Launch AWS Fault Injection Service experiments to test system resilience by executing predefined chaos engineering templates.

Instructions

Start a new AWS FIS experiment based on an experiment template.

Args:
    template_id: ID of the experiment template to use
    region: AWS region to use (default: us-east-1)
    client_token: Optional client token for idempotency
    
Returns:
    JSON string containing the started experiment information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
template_idYes
regionNous-east-1
client_tokenNo

Implementation Reference

  • The handler function that implements the core logic of the 'start_experiment' tool. It uses boto3 to call AWS FIS start_experiment API, handles client token, serializes datetime objects, and returns JSON response.
    @require_write_mode
    def start_experiment(template_id: str, region: str = "us-east-1", client_token: Optional[str] = None) -> str:
        """
        Start a new AWS FIS experiment based on an experiment template.
        
        Args:
            template_id: ID of the experiment template to use
            region: AWS region to use (default: us-east-1)
            client_token: Optional client token for idempotency
            
        Returns:
            JSON string containing the started experiment information
        """
        try:
            fis = boto3.client('fis', region_name=region)
            
            # Generate a client token if not provided
            if not client_token:
                client_token = str(uuid.uuid4())
            
            response = fis.start_experiment(
                experimentTemplateId=template_id,
                clientToken=client_token
            )
            
            # Get the raw experiment data and serialize datetime objects
            experiment = response.get('experiment', {})
            serialized_experiment = _serialize_datetime(experiment)
            
            return json.dumps(serialized_experiment, indent=2)
        except Exception as e:
            return f"Error starting experiment: {str(e)}"
  • Registration of the 'start_experiment' handler function as a tool in the FastMCP server application.
    app.tool()(start_experiment)
  • Helper function used by start_experiment to recursively serialize datetime objects to ISO strings in the response.
    def _serialize_datetime(obj: Any) -> Any:
        """
        Recursively serialize datetime objects to ISO format strings.
        
        Args:
            obj: Object that may contain datetime objects
            
        Returns:
            Object with datetime objects converted to ISO format strings
        """
        if isinstance(obj, datetime):
            return obj.isoformat()
        elif isinstance(obj, dict):
            return {key: _serialize_datetime(value) for key, value in obj.items()}
        elif isinstance(obj, list):
            return [_serialize_datetime(item) for item in obj]
        else:
            return obj
  • Decorator applied to start_experiment to enforce write mode requirement for destructive operations.
    def require_write_mode(func):
        """Decorator to require write mode for destructive operations."""
        @wraps(func)
        def wrapper(*args, **kwargs):
            if not _WRITE_MODE_ENABLED:
                return json.dumps({
                    "error": "Write operations are disabled",
                    "message": f"The '{func.__name__}' operation requires write mode. Please restart the server with --allow-writes flag to enable write operations.",
                    "operation": func.__name__,
                    "read_only_mode": True
                }, indent=2)
            return func(*args, **kwargs)
        return wrapper
  • Import statement that brings the start_experiment function into the server module for registration.
    from aws_fis_mcp.tools import (
        list_experiment_templates,
        get_experiment_template,
        list_experiments,
        get_experiment,
        start_experiment,
        stop_experiment,
        create_experiment_template,
        delete_experiment_template,
        list_action_types,
        generate_template_example,
        set_write_mode,
    )
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'idempotency' for client_token, which adds some behavioral context, but lacks details on permissions needed, rate limits, what 'start' entails (e.g., immediate execution, costs), or error handling. For a mutation tool with no annotations, 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, followed by a structured Args/Returns section. Every sentence adds value: the first states the action, and the parameter explanations are necessary given low schema coverage. No wasted words or redundancy.

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 3 parameters with 0% schema coverage and no output schema, the description is incomplete. It explains parameters but lacks details on return values beyond 'JSON string containing the started experiment information' (e.g., structure, fields). For a mutation tool with no annotations, more behavioral context is needed.

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?

Schema description coverage is 0%, so the description must compensate. It adds meaning by explaining template_id ('ID of the experiment template to use'), region ('AWS region to use'), and client_token ('Optional client token for idempotency'), which clarifies purpose beyond schema titles. However, it doesn't specify format or constraints for template_id or region.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Start a new AWS FIS experiment') and resource ('based on an experiment template'), distinguishing it from siblings like create_experiment_template (creates templates) or stop_experiment (stops experiments). The verb 'Start' is precise and the AWS FIS context is explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by specifying it starts experiments 'based on an experiment template', suggesting it should be used when a template exists, but it doesn't explicitly state when to use this vs. alternatives like create_experiment_template or list_experiments. No exclusions or clear alternatives are provided, leaving some ambiguity.

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/RadiumGu/aws-fis-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server