Skip to main content
Glama
RadiumGu
by RadiumGu

create_experiment_template

Create AWS FIS experiment templates to define chaos engineering scenarios with targets, actions, and stop conditions for testing system resilience.

Instructions

Create a new AWS FIS experiment template.

Args:
    name: Name for the experiment template
    description: Description of the experiment template
    targets: Dictionary of targets configuration
    actions: Dictionary of actions configuration
    role_arn: ARN of the IAM role to use for the experiment
    stop_conditions: List of stop conditions
    region: AWS region to use (default: us-east-1)
    
Returns:
    JSON string containing the created template information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
descriptionYes
targetsYes
actionsYes
role_arnYes
stop_conditionsYes
regionNous-east-1

Implementation Reference

  • The handler function for the 'create_experiment_template' tool. It is decorated with @require_write_mode and uses boto3 to create an AWS FIS experiment template, returning formatted JSON.
    @require_write_mode
    def create_experiment_template(
        name: str,
        description: str,
        targets: Dict[str, Dict[str, Any]],
        actions: Dict[str, Dict[str, Any]],
        role_arn: str,
        stop_conditions: List[Dict[str, Any]],
        region: str = "us-east-1"
    ) -> str:
        """
        Create a new AWS FIS experiment template.
        
        Args:
            name: Name for the experiment template
            description: Description of the experiment template
            targets: Dictionary of targets configuration
            actions: Dictionary of actions configuration
            role_arn: ARN of the IAM role to use for the experiment
            stop_conditions: List of stop conditions
            region: AWS region to use (default: us-east-1)
            
        Returns:
            JSON string containing the created template information
        """
        try:
            fis = boto3.client('fis', region_name=region)
            
            response = fis.create_experiment_template(
                clientToken=str(uuid.uuid4()),
                description=description,
                targets=targets,
                actions=actions,
                stopConditions=stop_conditions,
                roleArn=role_arn,
                tags={'Name': name}
            )
            
            # Format the response for better readability
            template = response.get('experimentTemplate', {})
            formatted_template = {
                'id': template.get('id'),
                'description': template.get('description'),
                'creationTime': template.get('creationTime').isoformat() if template.get('creationTime') else None,
                'tags': template.get('tags', {})
            }
            
            return json.dumps(formatted_template, indent=2)
        except Exception as e:
            return f"Error creating experiment template: {str(e)}"
  • Registers the create_experiment_template handler as a tool in the FastMCP server instance.
    app.tool()(create_experiment_template)
  • Decorator applied to the handler that enforces write mode requirement, preventing execution unless --allow-writes is enabled.
    def require_write_mode(func):
        """Decorator to require write mode for destructive operations."""
        @wraps(func)
        def wrapper(*args, **kwargs):
            if not _WRITE_MODE_ENABLED:
                return json.dumps({
                    "error": "Write operations are disabled",
                    "message": f"The '{func.__name__}' operation requires write mode. Please restart the server with --allow-writes flag to enable write operations.",
                    "operation": func.__name__,
                    "read_only_mode": True
                }, indent=2)
            return func(*args, **kwargs)
        return wrapper
  • Global function to set the write mode flag used by the require_write_mode decorator.
    def set_write_mode(enabled: bool) -> None:
        """Set the global write mode."""
        global _WRITE_MODE_ENABLED
        _WRITE_MODE_ENABLED = enabled
  • Import of the create_experiment_template handler from tools module for use in server registration.
    create_experiment_template,
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Create' implies a write/mutation operation, the description doesn't mention permission requirements, whether this is idempotent, what happens on failure, rate limits, or any side effects. It provides basic functional information but lacks critical behavioral context for a creation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with a clear purpose statement followed by organized parameter documentation. Every sentence serves a purpose, though the 'Returns' section could be slightly more informative given there's no output schema. The formatting with Args/Returns sections is helpful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex creation tool with 7 parameters (6 required), nested objects, no annotations, and no output schema, the description provides adequate functional coverage but lacks important contextual information. It explains what parameters are needed but doesn't address behavioral aspects, error handling, or relationship to sibling tools that would help an agent use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description compensates well by listing all 7 parameters with brief explanations of their purpose. It clarifies that 'targets' and 'actions' are dictionaries, 'stop_conditions' is a list, and provides the default for 'region'. This adds meaningful semantic context beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Create') and resource ('new AWS FIS experiment template'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'generate_template_example' or explain how this creation differs from other template-related operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'generate_template_example' or 'get_experiment_template'. There's no mention of prerequisites, typical use cases, or scenarios where this tool would be preferred over other template-related operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RadiumGu/aws-fis-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server