Skip to main content
Glama
aliyun

AlibabaCloud MCP Server

Official
by aliyun

ResetPassword

Reset passwords for AlibabaCloud ECS instances in bulk. Requires instance restart after password update to ensure security and synchronization across resources.

Instructions

批量修改ECS实例的密码,请注意,本操作将会重启ECS实例

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
InstanceIdsYesAlibabaCloud ECS instance ID List
PasswordYesThe password of the ECS instance must be 8-30 characters and must contain only the following characters: lowercase letters, uppercase letters, numbers, and special characters only.()~!@#$%^&*-_+=(40:<>,?/
RegionIdNoAlibabaCloud region IDcn-hangzhou

Implementation Reference

  • Handler for the 'OOS_ResetPassword' tool, which resets the password for multiple Alibaba Cloud ECS instances using the OOS template 'ACS-ECS-BulkyResetPassword'. Note: This matches 'ResetPassword' functionality.
    @tools.append
    def OOS_ResetPassword(
        InstanceIds: List[str] = Field(description='AlibabaCloud ECS instance ID List'),
        Password: str = Field(description='The password of the ECS instance must be 8-30 characters and must contain only the following characters: lowercase letters, uppercase letters, numbers, and special characters only.()~!@#$%^&*-_+=(40:<>,?/'),
        RegionId: str = Field(description='AlibabaCloud region ID', default='cn-hangzhou'),
    ):
        """批量修改ECS实例的密码,请注意,本操作将会重启ECS实例"""
        parameters = {
            'regionId': RegionId,
            'resourceType': 'ALIYUN::ECS::Instance',
            'targets': {
                'ResourceIds': InstanceIds,
                'RegionId': RegionId,
                'Type': 'ResourceIds'
            },
            'password': Password
        }
        return _start_execution_sync(region_id=RegionId, template_name='ACS-ECS-BulkyResetPassword', parameters=parameters)
  • Input schema defined by Pydantic Field descriptions in the handler function parameters.
    @tools.append
    def OOS_ResetPassword(
        InstanceIds: List[str] = Field(description='AlibabaCloud ECS instance ID List'),
        Password: str = Field(description='The password of the ECS instance must be 8-30 characters and must contain only the following characters: lowercase letters, uppercase letters, numbers, and special characters only.()~!@#$%^&*-_+=(40:<>,?/'),
        RegionId: str = Field(description='AlibabaCloud region ID', default='cn-hangzhou'),
    ):
        """批量修改ECS实例的密码,请注意,本操作将会重启ECS实例"""
        parameters = {
            'regionId': RegionId,
            'resourceType': 'ALIYUN::ECS::Instance',
            'targets': {
                'ResourceIds': InstanceIds,
                'RegionId': RegionId,
                'Type': 'ResourceIds'
            },
            'password': Password
        }
        return _start_execution_sync(region_id=RegionId, template_name='ACS-ECS-BulkyResetPassword', parameters=parameters)
  • Registration loop that adds all tools from oos_tools.tools (including OOS_ResetPassword) to the FastMCP server.
    for tool in oos_tools.tools:
        mcp.tool(tool)
  • Shared helper function used by OOS_ResetPassword and other OOS tools to start an execution and poll until completion.
    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)
    @tools.append
Behavior4/5

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

With no annotations provided, the description carries full burden and adds crucial behavioral context: it explicitly warns that the operation will restart ECS instances ('本操作将会重启ECS实例'). This discloses a significant side effect not evident from the input schema alone, though it could further detail authentication needs or rate limits.

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 extremely concise with just two clauses: the core purpose and a critical warning. Every word earns its place, and the warning is front-loaded after the main action, making it immediately noticeable without unnecessary elaboration.

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 mutation tool with no annotations and no output schema, the description is minimally complete: it states the purpose and a key behavioral trait (restart). However, it lacks details on permissions, error handling, or return values, leaving gaps given the tool's destructive nature and complexity.

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 thoroughly. The description doesn't add any parameter-specific semantics beyond what's in the schema, maintaining the baseline score of 3 for adequate but no extra value.

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

Purpose5/5

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

The description clearly states the specific action ('批量修改ECS实例的密码' - batch modify ECS instance passwords) and resource ('ECS实例' - ECS instances). It distinguishes from siblings like 'RebootInstances' by specifying password reset as the primary purpose, not just restarting.

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 implies usage context through the warning about instance restart, suggesting this tool should be used when password changes are needed despite downtime. However, it doesn't explicitly state when to use this vs alternatives like 'RunCommand' for remote password changes or 'RebootInstances' for just restarting without password modification.

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