get_experiment_template
Retrieve detailed information about an AWS Fault Injection Service experiment template to understand its configuration and parameters for chaos engineering experiments.
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 retrieves an AWS FIS experiment template using boto3 and returns formatted JSON.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.app.tool()(get_experiment_template)
- aws_fis_mcp/server.py:7-19 (registration)Imports the get_experiment_template function from tools.py for use in the server.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, )