get_experiment_template
Retrieve detailed configuration and parameters for AWS Fault Injection Service experiment templates to analyze chaos engineering setups.
Instructions
Get detailed information about a specific AWS FIS experiment template.
Args:
template_id: ID of the experiment template to retrieve
region: AWS region to query (default: us-east-1)
Returns:
JSON string containing detailed template information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template_id | Yes | ||
| region | No | us-east-1 |
Implementation Reference
- aws_fis_mcp/tools.py:88-117 (handler)The handler function that executes the tool logic: retrieves AWS FIS experiment template by ID using boto3, formats key fields into a JSON response.def get_experiment_template(template_id: str, region: str = "us-east-1") -> str: """ Get detailed information about a specific AWS FIS experiment template. Args: template_id: ID of the experiment template to retrieve region: AWS region to query (default: us-east-1) Returns: JSON string containing detailed template information """ try: fis = boto3.client('fis', region_name=region) response = fis.get_experiment_template(id=template_id) # Format the response for better readability template = response.get('experimentTemplate', {}) formatted_template = { 'id': template.get('id'), 'description': template.get('description'), 'targets': template.get('targets', {}), 'actions': template.get('actions', {}), 'stopConditions': template.get('stopConditions', []), 'roleArn': template.get('roleArn'), 'tags': template.get('tags', {}) } return json.dumps(formatted_template, indent=2) except Exception as e: return f"Error retrieving experiment template: {str(e)}"
- aws_fis_mcp/server.py:26-26 (registration)Registers the get_experiment_template tool with the FastMCP server using app.tool() decorator.app.tool()(get_experiment_template)