list_experiment_templates
Retrieve AWS Fault Injection Service experiment templates to manage chaos engineering experiments in a specified AWS region.
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 implements the 'list_experiment_templates' tool logic. It creates a boto3 FIS client, calls list_experiment_templates(), formats the response into a readable JSON list of templates with key fields, and handles errors.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)The registration of the 'list_experiment_templates' tool with the FastMCP server instance using the @app.tool() decorator.app.tool()(list_experiment_templates)