Skip to main content
Glama
RadiumGu
by RadiumGu

stop_experiment

Stop a running AWS Fault Injection Service experiment by providing its ID to halt chaos engineering tests and prevent further system disruptions.

Instructions

Stop a running AWS FIS experiment.

Args:
    experiment_id: ID of the experiment to stop
    region: AWS region to use (default: us-east-1)
    
Returns:
    JSON string containing the stopped experiment information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
experiment_idYes
regionNous-east-1

Implementation Reference

  • The core handler function for the 'stop_experiment' tool. It uses boto3 to call AWS FIS stop_experiment API, serializes the response with datetime handling, and returns JSON. Protected by write mode decorator.
    @require_write_mode
    def stop_experiment(experiment_id: str, region: str = "us-east-1") -> str:
        """
        Stop a running AWS FIS experiment.
        
        Args:
            experiment_id: ID of the experiment to stop
            region: AWS region to use (default: us-east-1)
            
        Returns:
            JSON string containing the stopped experiment information
        """
        try:
            fis = boto3.client('fis', region_name=region)
            response = fis.stop_experiment(id=experiment_id)
            
            # 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 stopping experiment: {str(e)}"
  • Registration of the stop_experiment tool handler using FastMCP app.tool() decorator.
    app.tool()(stop_experiment)
  • Helper function used by stop_experiment to recursively serialize datetime objects in the response to ISO strings for JSON output.
    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 stop_experiment requiring write mode to be enabled for execution, preventing accidental destructive actions.
    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 bringing the stop_experiment handler 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?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool stops an experiment and returns JSON, but doesn't cover critical aspects like whether this is a destructive/mutative action (implied but not explicit), potential side effects, authentication needs, rate limits, or error conditions. This leaves significant gaps for agent understanding.

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 with the core purpose in the first sentence. The Args/Returns sections are structured efficiently, though the 'Returns' line could be more specific about the JSON content. No wasted sentences, but minor room for refinement.

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 (stopping AWS experiments), lack of annotations, and no output schema, the description is minimally adequate. It covers basic purpose and parameters but misses behavioral details like what 'stop' entails operationally, success/failure states, or how it interacts with sibling tools. More context would help the agent use it correctly.

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?

The description adds meaningful context for both parameters beyond the schema's 0% coverage: it explains 'experiment_id' identifies the experiment to stop and 'region' specifies AWS region with a default. This compensates well for the schema's lack of descriptions, though it doesn't detail format constraints (e.g., ID patterns or valid regions).

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 action ('Stop') and target resource ('a running AWS FIS experiment'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_experiment' or 'start_experiment' beyond the obvious verb difference, which keeps it from 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 like 'get_experiment' for checking status or 'start_experiment' for initiating experiments. It lacks context about prerequisites (e.g., experiment must be running) or exclusions, leaving usage decisions to inference.

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