Skip to main content
Glama
RadiumGu
by RadiumGu

list_experiments

Retrieve all AWS Fault Injection Service experiments in a specified region to monitor and manage chaos engineering tests.

Instructions

List all AWS FIS experiments in the specified region.

Args:
    region: AWS region to query (default: us-east-1)
    
Returns:
    JSON string containing experiments information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionNous-east-1

Implementation Reference

  • The core handler function for the 'list_experiments' tool. It uses boto3 to call fis.list_experiments(), processes the response by extracting key fields and serializing datetimes to ISO format, then returns a formatted JSON string of the experiments list.
    def list_experiments(region: str = "us-east-1") -> str:
        """
        List all AWS FIS experiments in the specified region.
        
        Args:
            region: AWS region to query (default: us-east-1)
            
        Returns:
            JSON string containing experiments information
        """
        try:
            fis = boto3.client('fis', region_name=region)
            response = fis.list_experiments()
            
            if not response.get('experiments'):
                return "No experiments found in region " + region
            
            # Format the response for better readability
            experiments = []
            for experiment in response['experiments']:
                experiments.append({
                    'id': experiment.get('id'),
                    'experimentTemplateId': experiment.get('experimentTemplateId'),
                    'state': experiment.get('state', {}).get('status'),
                    'startTime': experiment.get('startTime').isoformat() if experiment.get('startTime') else None,
                    'endTime': experiment.get('endTime').isoformat() if experiment.get('endTime') else None,
                    'tags': experiment.get('tags', {})
                })
            
            return json.dumps(experiments, indent=2)
        except Exception as e:
            return f"Error listing experiments: {str(e)}"
  • Registers the list_experiments function as an MCP tool using FastMCP's app.tool() decorator.
    app.tool()(list_experiments)
  • Imports the list_experiments function from tools.py for use in the server 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,
    )

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