Skip to main content
Glama
RadiumGu

Alibaba Cloud Operations MCP Server

by RadiumGu

reboot_ecs_instances

Restart Alibaba Cloud ECS instances to apply configuration changes, resolve performance issues, or recover from system failures by specifying region and instance IDs.

Instructions

重启ECS实例

Args:
    region: 区域ID,如cn-beijing
    instance_ids: ECS实例ID列表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionNocn-beijing
instance_idsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Primary handler and registration for the MCP tool 'reboot_ecs_instances'. Dynamically locates and calls the underlying OOS_RebootInstances helper from oos_tools.tools.
    @app.tool()
    def reboot_ecs_instances(region: str = "cn-beijing", instance_ids: List[str] = None) -> str:
        """重启ECS实例
        
        Args:
            region: 区域ID,如cn-beijing
            instance_ids: ECS实例ID列表
        """
        try:
            sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'alibaba_cloud_ops_mcp_server'))
            from tools import oos_tools
            
            if not instance_ids:
                return "请提供ECS实例ID列表"
            
            for tool_func in oos_tools.tools:
                if hasattr(tool_func, '__name__') and 'reboot' in tool_func.__name__.lower() and 'instance' in tool_func.__name__.lower():
                    result = tool_func(RegionId=region, InstanceIds=instance_ids)
                    return str(result)
            
            return f"ECS实例重启功能可用,region: {region}, 实例: {instance_ids}"
        except Exception as e:
            return f"ECS实例重启失败: {str(e)}"
  • Core implementation logic for rebooting ECS instances using Alibaba Cloud OOS (Operations Service) with the 'ACS-ECS-BulkyRebootInstances' template. Includes Pydantic Field definitions serving as input schema.
    @tools.append
    def OOS_RebootInstances(
        InstanceIds: List[str] = Field(description='AlibabaCloud ECS instance ID List'),
        RegionId: str = Field(description='AlibabaCloud region ID', default='cn-hangzhou'),
        ForeceStop: bool = Field(description='Is forced shutdown required', default=False)
    ):
        """批量重启ECS实例,适用于需要同时管理和重启多台ECS实例的场景。"""
        
        parameters = {
            'regionId': RegionId,
            'resourceType': 'ALIYUN::ECS::Instance',
            'targets': {
                'ResourceIds': InstanceIds,
                'RegionId': RegionId,
                'Type': 'ResourceIds'
            },
            'forceStop': ForeceStop
        }
        return _start_execution_sync(region_id=RegionId, template_name='ACS-ECS-BulkyRebootInstances', parameters=parameters)
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states the action (restart) but doesn't describe critical behaviors: whether this requires specific permissions, if it's destructive (e.g., data loss risk), expected downtime, rate limits, or what happens if instances are already stopped. For a mutation tool with zero annotation coverage, this is a significant gap.

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 appropriately sized and front-loaded with the purpose in the first line, followed by parameter explanations. It avoids unnecessary details, though the structure could be slightly improved by separating purpose from args more clearly. Every sentence serves a purpose.

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 complexity (mutation with 2 parameters), no annotations, and an output schema (which reduces need to describe returns), the description is minimally adequate. It covers the action and parameters but lacks behavioral context, usage guidelines, and deeper parameter semantics. It's incomplete for safe and effective use.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate. It adds basic semantics: 'region' as region ID with an example (cn-beijing) and 'instance_ids' as a list of ECS instance IDs. However, it doesn't explain format constraints, validation rules, or optionality (both parameters have defaults but no required status). The description provides minimal value beyond the schema's structure.

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 states '重启ECS实例' (Restart ECS instances), which clearly indicates the verb (restart) and resource (ECS instances). It distinguishes from siblings like start_ecs_instances and stop_ecs_instances by specifying the restart action, though it doesn't explicitly contrast them. The purpose is specific and unambiguous.

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 start_ecs_instances or stop_ecs_instances. It lacks context about prerequisites (e.g., instance state), exclusions, or typical scenarios for restarting versus other operations. Usage is implied only by the action name.

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/alicloud-ops-mcp'

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