Skip to main content
Glama
RadiumGu

Alibaba Cloud Operations MCP Server

by RadiumGu

describe_ecs_instances

Retrieve detailed information about Elastic Compute Service instances in a specified Alibaba Cloud region to monitor and manage cloud resources.

Instructions

查询ECS实例信息

Args:
    region: 区域ID,如cn-beijing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionNocn-beijing

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function implementing the 'describe_ecs_instances' tool logic. Registered via @app.tool() decorator. Delegates to a keyword-matching tool in common_api_tools.tools or returns availability message.
    def describe_ecs_instances(region: str = "cn-beijing") -> str:
        """查询ECS实例信息
        
        Args:
            region: 区域ID,如cn-beijing
        """
        try:
            sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'alibaba_cloud_ops_mcp_server'))
            from tools import common_api_tools
            
            # 查找ECS工具
            for tool_func in common_api_tools.tools:
                if hasattr(tool_func, '__name__') and 'describe' in tool_func.__name__.lower() and 'instance' in tool_func.__name__.lower():
                    result = tool_func(RegionId=region)
                    return str(result)
            
            return f"ECS实例查询功能可用,查询region: {region}"
        except Exception as e:
            return f"ECS查询失败: {str(e)}"
  • The @app.tool() decorator registers this function as an MCP tool named 'describe_ecs_instances'.
    def describe_ecs_instances(region: str = "cn-beijing") -> str:
        """查询ECS实例信息
        
        Args:
            region: 区域ID,如cn-beijing
        """
        try:
            sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'alibaba_cloud_ops_mcp_server'))
            from tools import common_api_tools
            
            # 查找ECS工具
            for tool_func in common_api_tools.tools:
                if hasattr(tool_func, '__name__') and 'describe' in tool_func.__name__.lower() and 'instance' in tool_func.__name__.lower():
                    result = tool_func(RegionId=region)
                    return str(result)
            
            return f"ECS实例查询功能可用,查询region: {region}"
        except Exception as e:
            return f"ECS查询失败: {str(e)}"
  • Generic API caller used potentially by the handler to invoke actual Alibaba Cloud DescribeInstances API, though keyword matching doesn't hit this.
    def CommonAPICaller(
            service: str = Field(description='AlibabaCloud service code'),
            api: str = Field(description='AlibabaCloud api name'),
            parameters: dict = Field(description='AlibabaCloud ECS instance ID List', default={}),
    ):
        """
        Use PromptUnderstanding tool first to understand the user's query, Perform the actual call by specifying the Service, API, and Parameters
        """
        return _tools_api_call(service, api, parameters, None)
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states it queries information without mentioning authentication requirements, rate limits, error conditions, pagination behavior, or what specific information is returned. For a query tool with zero annotation coverage, this provides minimal behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

The description is brief with two sentences, but the structure is basic. The first sentence states the purpose, the second documents the parameter. While efficient, it could be more front-loaded with key information and lacks formatting that would enhance readability for an AI agent.

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 has an output schema (which handles return values) and only one parameter, the description covers the basic purpose and parameter meaning. However, for a query tool with no annotations, it should ideally mention authentication needs, rate limits, or what kind of instance information is returned. The presence of an output schema elevates the score from what would otherwise be lower.

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

Parameters4/5

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

The description provides the only documentation for the single parameter 'region', explaining it's a region ID with an example 'cn-beijing'. Since schema description coverage is 0% and there's only one parameter, the description fully compensates by providing clear semantic meaning and an example, though it doesn't explain regional constraints or valid values.

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

Purpose3/5

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

The description states '查询ECS实例信息' (Query ECS instance information), which provides a clear verb ('查询'/query) and resource ('ECS实例'/ECS instances). However, it doesn't differentiate from siblings like 'describe_ecs_regions' or 'describe_ecs_zones' - all describe ECS-related entities. The purpose is clear but lacks sibling distinction.

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?

No guidance is provided about when to use this tool versus alternatives. There's no mention of when this tool is appropriate versus other ECS tools like 'reboot_ecs_instances', 'start_ecs_instances', or 'stop_ecs_instances', nor does it explain its relationship to 'describe_ecs_regions' or 'describe_ecs_zones'. The description only states what it does, not when to use it.

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