Skip to main content
Glama
RadiumGu
by RadiumGu

generate_template_example

Create example AWS Fault Injection Service experiment templates to test system resilience by injecting failures into specified AWS resources and actions.

Instructions

Generate an example AWS FIS experiment template for a given target and action type.

Args:
    target_type: Target resource type (default: aws:ec2:instance)
    action_type: Action type to perform (default: aws:ec2:stop-instances)
    region: AWS region to use (default: us-east-1)
    
Returns:
    JSON string containing an example template configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
target_typeNoaws:ec2:instance
action_typeNoaws:ec2:stop-instances
regionNous-east-1

Implementation Reference

  • The handler function that executes the logic for the 'generate_template_example' tool, generating a sample AWS FIS experiment template JSON.
    def generate_template_example(
        target_type: str = "aws:ec2:instance", 
        action_type: str = "aws:ec2:stop-instances",
        region: str = "us-east-1"
    ) -> str:
        """
        Generate an example AWS FIS experiment template for a given target and action type.
        
        Args:
            target_type: Target resource type (default: aws:ec2:instance)
            action_type: Action type to perform (default: aws:ec2:stop-instances)
            region: AWS region to use (default: us-east-1)
            
        Returns:
            JSON string containing an example template configuration
        """
        try:
            # Example template structure
            template = {
                "description": f"Example experiment template for {action_type} on {target_type}",
                "targets": {
                    "MyTargets": {
                        "resourceType": target_type,
                        "resourceArns": ["REPLACE_WITH_ACTUAL_RESOURCE_ARN"],
                        "selectionMode": "ALL"
                    }
                },
                "actions": {
                    "MyAction": {
                        "actionId": action_type,
                        "parameters": {},
                        "targets": {
                            "Instances": "MyTargets"
                        }
                    }
                },
                "stopConditions": [
                    {
                        "source": "none"
                    }
                ],
                "roleArn": "REPLACE_WITH_ACTUAL_ROLE_ARN",
                "tags": {
                    "Name": f"Example-{target_type}-{action_type}"
                }
            }
            
            # Add common parameters based on action type
            if action_type == "aws:ec2:stop-instances":
                template["actions"]["MyAction"]["parameters"] = {
                    "startAfter": "PT0M"
                }
            elif action_type == "aws:ec2:reboot-instances":
                template["actions"]["MyAction"]["parameters"] = {
                    "startAfter": "PT0M"
                }
            
            return json.dumps(template, indent=2)
        except Exception as e:
            return f"Error generating template example: {str(e)}"
  • Registers the generate_template_example handler as an MCP tool using FastMCP's app.tool() decorator.
    app.tool()(generate_template_example)
  • Imports the generate_template_example function from tools.py for use in tool 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,
    )
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions the tool generates an example template and returns a JSON string, but lacks details on behavioral traits such as whether it's read-only, if it has side effects (e.g., simulating actions), rate limits, or authentication needs. This is a significant gap for a tool with no annotation coverage.

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

Conciseness5/5

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

The description is front-loaded with the core purpose, followed by a structured 'Args' and 'Returns' section. Every sentence adds value without redundancy, making it efficient and easy to parse.

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?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers the purpose and parameters well, but lacks behavioral context (e.g., safety, side effects) and doesn't detail the output format beyond 'JSON string', which could be more specific for an example template.

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?

The description adds meaningful semantics beyond the input schema, which has 0% description coverage. It explains that 'target_type' is the 'Target resource type', 'action_type' is the 'Action type to perform', and 'region' is the 'AWS region to use', including default values. This compensates well for the schema's lack of descriptions.

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 tool's purpose: 'Generate an example AWS FIS experiment template for a given target and action type.' It specifies the verb ('generate'), resource ('AWS FIS experiment template'), and scope ('example'), though it doesn't explicitly differentiate from siblings like 'create_experiment_template' beyond the 'example' qualifier.

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

Usage Guidelines3/5

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

Usage is implied by the description as a tool for generating examples, but there's no explicit guidance on when to use this versus alternatives like 'create_experiment_template' for actual creation or 'get_experiment_template' for retrieving existing ones. The context suggests it's for learning or testing, but this isn't stated.

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