Skip to main content
Glama
aliyun

Alibaba Cloud MCP Server

Official
by aliyun

StartInstances

Initiate and manage the simultaneous start of multiple Alibaba Cloud ECS instances, ideal for application deployment or high-availability scenarios.

Instructions

批量启动ECS实例,适用于需要同时管理和启动多台ECS实例的场景,例如应用部署和高可用性场景。

Input Schema

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

Implementation Reference

  • The main handler function for the tool OOS_StartInstances, which starts multiple ECS instances using the OOS template 'ACS-ECS-BulkyStartInstances'. Note: The tool is named 'OOS_StartInstances', not exactly 'StartInstances', but matches the search.
    @tools.append
    def OOS_StartInstances(
        InstanceIds: List[str] = Field(description='AlibabaCloud ECS instance ID List'),
        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'
            }
        }
        return _start_execution_sync(region_id=RegionId, template_name='ACS-ECS-BulkyStartInstances', parameters=parameters)
  • Helper function used by OOS_StartInstances to synchronously start an OOS 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)
  • Registration loop where all tools from oos_tools.tools (including OOS_StartInstances) are registered to the MCP server using mcp.tool(tool).
    for tool in oos_tools.tools:
        mcp.tool(tool)
  • Import of oos_tools module containing the tool.
    from alibaba_cloud_ops_mcp_server.tools import cms_tools, oos_tools, oss_tools, api_tools, common_api_tools
    from alibaba_cloud_ops_mcp_server.settings import settings
    
    logger = logging.getLogger(__name__)
    
    SUPPORTED_SERVICES_MAP = {
        "ecs": "Elastic Compute Service (ECS)",
        "oos": "Operations Orchestration Service (OOS)",
        "rds": "Relational Database Service (RDS)",
        "vpc": "Virtual Private Cloud (VPC)",
        "slb": "Server Load Balancer (SLB)",
        "ess": "Elastic Scaling (ESS)",
        "ros": "Resource Orchestration Service (ROS)",
        "cbn": "Cloud Enterprise Network (CBN)",
        "dds": "MongoDB Database Service (DDS)",
        "r-kvstore": "Cloud database Tair (compatible with Redis) (R-KVStore)",
        "bssopenapi": "Billing and Cost Management (BssOpenAPI)"
    }
    
    
    @click.command()
    @click.option(
        "--transport",
        type=click.Choice(["stdio", "sse", "streamable-http"]),
        default="stdio",
        help="Transport type",
    )
    @click.option(
        "--port",
        type=int,
        default=8000,
        help="Port number",
    )
    @click.option(
        "--host",
        type=str,
        default="127.0.0.1",
        help="Host",
    )
    @click.option(
        "--services",
        type=str,
        default=None,
        help="Comma-separated list of supported services, e.g., 'ecs,vpc,rds'",
    )
    @click.option(
        "--headers-credential-only",
        type=bool,
        default=False,
        help="Whether to use credentials only from headers",
    )
    @click.option(
        "--env",
        type=click.Choice(["domestic", "international"]),
        default="domestic",
        help="Environment type: 'domestic' for domestic, 'international' for overseas (default: domestic)",
    )
    def main(transport: str, port: int, host: str, services: str, headers_credential_only: bool, env: str):
        # Create an MCP server
        mcp = FastMCP(
            name="alibaba-cloud-ops-mcp-server",
            port=port,
            host=host,
            stateless_http=True
        )
        if headers_credential_only:
            settings.headers_credential_only = headers_credential_only
        if env:
            settings.env = env
        if services:
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 is for batch operations but doesn't disclose critical behavioral traits such as permissions required, whether it's idempotent (e.g., starting already-running instances), potential costs, rate limits, or error handling. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 that front-loads the purpose and provides context. Every part earns its place by explaining the tool's function and typical use cases without unnecessary elaboration, though it could be slightly more structured for clarity.

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 mutation tool (starting instances) with no annotations and no output schema, the description is incomplete. It lacks details on behavioral aspects (e.g., side effects, permissions), output format, or error conditions, which are crucial for safe and effective use. The description does not compensate for the missing structured data.

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%, with both parameters (InstanceIds and RegionId) well-documented in the schema. The description doesn't add any meaningful parameter details beyond what's in the schema, such as format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate as the schema handles 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 start) and resource ('ECS实例' - ECS instances), and specifies it's for managing multiple instances simultaneously. However, it doesn't explicitly differentiate from sibling tools like 'RunInstances' (which creates new instances) or 'RebootInstances' (which restarts running instances), though the context of 'starting' versus 'creating' or 'rebooting' is implied.

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

Usage Guidelines4/5

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

The description provides clear usage context with examples ('应用部署和高可用性场景' - application deployment and high-availability scenarios), indicating when this tool is appropriate. It doesn't explicitly state when not to use it or name alternatives like 'RunInstances' for creating instances or 'StopInstances' for stopping them, but the context is sufficient for general guidance.

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