Skip to main content
Glama
aliyun

Alibaba Cloud MCP Server

Official
by aliyun

RebootInstances

Restart multiple Alibaba Cloud ECS instances simultaneously using this tool, ideal for managing instance lifecycle in bulk and ensuring consistent system performance.

Instructions

批量重启ECS实例,适用于需要同时管理和重启多台ECS实例的场景。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ForeceStopNo是否强制关机
InstanceIdsYesAlibabaCloud ECS instance ID List
RegionIdNoAlibabaCloud region IDcn-hangzhou

Implementation Reference

  • The handler function for the 'OOS_RebootInstances' tool (matching 'RebootInstances'), which orchestrates rebooting multiple Alibaba Cloud ECS instances using OOS template 'ACS-ECS-BulkyRebootInstances'.
    @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)
  • Registration loop that adds all tools from oos_tools (including OOS_RebootInstances) to the FastMCP server.
    for tool in oos_tools.tools:
        mcp.tool(tool)
  • Helper function _start_execution_sync that starts an OOS execution and polls until it reaches an end status, used by OOS_RebootInstances.
    def _start_execution_sync(region_id: str, template_name: str, parameters: dict):
        client = create_client(region_id=region_id)
        start_execution_request = oos_20190601_models.StartExecutionRequest(
            region_id=region_id,
            template_name=template_name,
            parameters=json.dumps(parameters)
        )
        start_execution_resp = client.start_execution(start_execution_request)
        execution_id = start_execution_resp.body.execution.execution_id
    
        while True:
            list_executions_request = oos_20190601_models.ListExecutionsRequest(
                region_id=region_id,
                execution_id=execution_id
            )
            list_executions_resp = client.list_executions(list_executions_request)
            status = list_executions_resp.body.executions[0].status
            if status == FAILED:
                status_message = list_executions_resp.body.executions[0].status_message
                raise exception.OOSExecutionFailed(reason=status_message)
            elif status in END_STATUSES:
                return list_executions_resp.body
            time.sleep(1)
  • Pydantic input schema definitions for the OOS_RebootInstances tool parameters.
    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)
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. It mentions '批量重启' (batch reboot) but doesn't disclose critical behavioral traits: whether this requires specific permissions, if it's destructive (reboot implies temporary downtime but not data loss), potential rate limits, or what happens to running processes. For a mutation tool with zero annotation coverage, this is inadequate.

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 a single, efficient sentence in Chinese that front-loads the core action. It could be slightly more structured by separating purpose from usage context, but it avoids redundancy and wastes no words.

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

Completeness2/5

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

Given this is a mutation tool (reboot) with no annotations, no output schema, and 3 parameters, the description is incomplete. It lacks information on permissions required, side effects (e.g., temporary unavailability), error conditions, or return values. The 100% schema coverage helps with parameters, but overall context for safe and effective use is insufficient.

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 100%, so the schema already documents all three parameters (InstanceIds, RegionId, ForceStop). The description doesn't add any parameter-specific semantics beyond implying batch operation through '批量' (batch), which aligns with InstanceIds being an array. Baseline 3 is appropriate when schema does the heavy lifting.

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 action ('批量重启' - batch reboot) and resource ('ECS实例' - ECS instances), making the purpose evident. It distinguishes from siblings like StartInstances and StopInstances by specifying reboot rather than start/stop operations. However, it doesn't explicitly differentiate from ReplaceSystemDisk or ResetPassword, which are also instance management tools.

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?

The description provides some context ('适用于需要同时管理和重启多台ECS实例的场景' - suitable for scenarios requiring simultaneous management and reboot of multiple ECS instances), implying this is for batch operations rather than single instances. However, it doesn't explicitly state when to use this versus alternatives like StopInstances followed by StartInstances, or when not to use it (e.g., during critical 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

Related 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/aliyun/alibabacloud-ecs-mcp-server'

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