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
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | us-east-1 |
Implementation Reference
- aws_fis_mcp/tools.py:120-151 (handler)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)}"
- aws_fis_mcp/server.py:27-27 (registration)Registers the list_experiments function as an MCP tool using FastMCP's app.tool() decorator.app.tool()(list_experiments)
- aws_fis_mcp/server.py:7-19 (registration)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, )