list_experiment_templates
Retrieve all AWS Fault Injection Service experiment templates in a specified region to manage chaos engineering experiments.
Instructions
List all AWS FIS experiment templates in the specified region.
Args:
region: AWS region to query (default: us-east-1)
Returns:
JSON string containing experiment templates information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | us-east-1 |
Implementation Reference
- aws_fis_mcp/tools.py:54-86 (handler)The core handler function that lists AWS FIS experiment templates using boto3, formats them into readable JSON, manually serializes datetimes, and handles exceptions.def list_experiment_templates(region: str = "us-east-1") -> str: """ List all AWS FIS experiment templates in the specified region. Args: region: AWS region to query (default: us-east-1) Returns: JSON string containing experiment templates information """ try: fis = boto3.client('fis', region_name=region) response = fis.list_experiment_templates() if not response.get('experimentTemplates'): return "No experiment templates found in region " + region # Format the response for better readability templates = [] for template in response['experimentTemplates']: templates.append({ 'id': template.get('id'), 'name': template.get('experimentTemplateId'), 'description': template.get('description'), 'creationTime': template.get('creationTime').isoformat() if template.get('creationTime') else None, 'lastUpdateTime': template.get('lastUpdateTime').isoformat() if template.get('lastUpdateTime') else None, 'tags': template.get('tags', {}) }) return json.dumps(templates, indent=2) except Exception as e: return f"Error listing experiment templates: {str(e)}"
- aws_fis_mcp/server.py:25-25 (registration)Registers the list_experiment_templates function as a tool in the FastMCP server.app.tool()(list_experiment_templates)
- aws_fis_mcp/server.py:7-19 (registration)Imports the list_experiment_templates handler along with other tools for 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, )