Skip to main content
Glama
aliyun

AlibabaCloud MCP Server

Official
by aliyun

ReplaceSystemDisk

Replace the system disk of AlibabaCloud ECS instances in bulk to update or change the operating system using a specified Image ID.

Instructions

批量替换ECS实例的系统盘,更换操作系统

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ImageIdYesImage ID
InstanceIdsYesAlibabaCloud ECS instance ID List
RegionIdNoAlibabaCloud region IDcn-hangzhou

Implementation Reference

  • The handler function OOS_ReplaceSystemDisk that implements the logic to replace system disks on multiple ECS instances using an OOS template.
    @tools.append
    def OOS_ReplaceSystemDisk(
        InstanceIds: List[str] = Field(description='AlibabaCloud ECS instance ID List'),
        ImageId: str = Field(description='Image ID'),
        RegionId: str = Field(description='AlibabaCloud region ID', default='cn-hangzhou')
    ):
        """批量替换ECS实例的系统盘,更换操作系统"""
        parameters = {
            'regionId': RegionId,
            'resourceType': 'ALIYUN::ECS::Instance',
            'targets': {
                'ResourceIds': InstanceIds,
                'RegionId': RegionId,
                'Type': 'ResourceIds'
            },
            'imageId': ImageId
        }
        return _start_execution_sync(region_id=RegionId, template_name='ACS-ECS-BulkyReplaceSystemDisk', parameters=parameters)
  • Helper function that starts an OOS execution and polls until it reaches a terminal state, used by ReplaceSystemDisk and other OOS tools.
    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)
  • The registration loop that adds all tools from oos_tools.tools (including OOS_ReplaceSystemDisk) to the FastMCP server instance.
    for tool in oos_tools.tools:
        mcp.tool(tool)
  • Pydantic input schema definition for the ReplaceSystemDisk tool parameters.
        InstanceIds: List[str] = Field(description='AlibabaCloud ECS instance ID List'),
        ImageId: str = Field(description='Image ID'),
        RegionId: str = Field(description='AlibabaCloud region ID', default='cn-hangzhou')
    ):
        """批量替换ECS实例的系统盘,更换操作系统"""
        parameters = {
            'regionId': RegionId,
            'resourceType': 'ALIYUN::ECS::Instance',
            'targets': {
                'ResourceIds': InstanceIds,
                'RegionId': RegionId,
                'Type': 'ResourceIds'
            },
            'imageId': ImageId
        }
        return _start_execution_sync(region_id=RegionId, template_name='ACS-ECS-BulkyReplaceSystemDisk', 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. It mentions '批量替换' (batch replacement) and '更换操作系统' (OS change), which implies a destructive, write operation. However, it lacks critical behavioral details: whether instances need to be stopped first, if data loss occurs, required permissions, rate limits, or what the response looks like. For a destructive 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.

Conciseness5/5

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

The description is a single, efficient sentence in Chinese: '批量替换ECS实例的系统盘,更换操作系统' (Batch replace ECS instance system disks, change the operating system). It's front-loaded with the core action and resource, with no wasted words or redundant information.

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 the complexity of a destructive batch operation (replacing system disks and changing OS), no annotations, and no output schema, the description is incomplete. It lacks essential context: prerequisites (e.g., instance state), side effects (data loss, downtime), error handling, and response format. For a high-stakes tool like this, the description should provide more guidance.

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 (ImageId, InstanceIds, RegionId) with basic descriptions. The description adds no additional parameter semantics beyond implying that ImageId relates to the new OS and InstanceIds are for batch operations. Baseline 3 is appropriate when the 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 replace) and resource ('ECS实例的系统盘' - ECS instance system disk), with the additional context of '更换操作系统' (changing the operating system). It's specific about what the tool does, though it doesn't explicitly differentiate from sibling tools like 'RebootInstances' or 'RunInstances' which might be related but serve different purposes.

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. It doesn't mention prerequisites (e.g., instance must be stopped), exclusions, or compare it to siblings like 'RunInstances' (which creates new instances) or 'RebootInstances' (which restarts without disk replacement). Usage is implied only by the action described.

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/alibaba-cloud-ops-mcp-server'

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