Skip to main content
Glama
RadiumGu

Alibaba Cloud Operations MCP Server

by RadiumGu

get_disk_usage_data

Retrieve disk usage metrics for Alibaba Cloud ECS instances to monitor storage capacity and identify potential issues.

Instructions

获取ECS实例磁盘使用率数据

Args:
    region: 区域ID,如cn-beijing
    instance_ids: ECS实例ID列表

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionNocn-beijing
instance_idsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler and registration for the 'get_disk_usage_data' MCP tool. Dynamically invokes CMS_GetDiskUsageData from cms_tools by matching function name keywords.
    @app.tool()
    def get_disk_usage_data(region: str = "cn-beijing", instance_ids: List[str] = None) -> str:
        """获取ECS实例磁盘使用率数据
        
        Args:
            region: 区域ID,如cn-beijing
            instance_ids: ECS实例ID列表
        """
        try:
            sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'alibaba_cloud_ops_mcp_server'))
            from tools import cms_tools
            
            if not instance_ids:
                instance_ids = ["示例实例ID"]
            
            for tool_func in cms_tools.tools:
                if hasattr(tool_func, '__name__') and 'disk' in tool_func.__name__.lower() and 'usage' in tool_func.__name__.lower():
                    result = tool_func(RegionId=region, InstanceIds=instance_ids)
                    return str(result)
            
            return f"磁盘使用率监控功能可用,region: {region}, 实例: {instance_ids}"
        except Exception as e:
            return f"磁盘监控查询失败: {str(e)}"
  • Direct helper function invoked by the handler to fetch disk usage data. Defines input schema with pydantic Fields and delegates to core metric fetcher.
    def CMS_GetDiskUsageData(
        InstanceIds: List[str] = Field(description='AlibabaCloud ECS instance ID List'),
        RegionId: str = Field(description='AlibabaCloud region ID', default='cn-hangzhou')
    ):
        """获取磁盘利用率指标数据"""
        return _get_cms_metric_data(RegionId, InstanceIds, 'diskusage_utilization')
  • Core utility function that performs the actual API call to Alibaba Cloud CMS to retrieve metric data (diskusage_utilization for this tool).
    def _get_cms_metric_data(region_id: str, instance_ids: List[str], metric_name: str):
        client = create_client(region_id)
        dimesion = []
        for instance_id in instance_ids:
            dimesion.append({
                'instanceId': instance_id
            })
        describe_metric_last_request = cms_20190101_models.DescribeMetricLastRequest(
            namespace='acs_ecs_dashboard',
            metric_name=metric_name,
            dimensions=json.dumps(dimesion),
        )
        describe_metric_last_resp = client.describe_metric_last(describe_metric_last_request)
        return describe_metric_last_resp.body.datapoints
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 of behavioral disclosure. It states the tool retrieves data ('获取'), implying a read-only operation, but doesn't clarify aspects like whether it requires specific permissions, rate limits, data freshness, or error conditions. For a data-fetching tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 appropriately sized and front-loaded: the first sentence states the purpose clearly, followed by a brief 'Args' section listing parameters. There's no unnecessary information, and each sentence serves a purpose. It could be slightly more structured with bullet points or clearer separation, but overall it's efficient.

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), the description covers the basic purpose and parameters. However, with no annotations and low schema coverage, it lacks context on behavioral traits like permissions or rate limits. For a simple data retrieval tool, this is minimally adequate but leaves room for improvement in guiding usage and transparency.

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?

The description adds basic semantics for both parameters: 'region' is described as '区域ID,如cn-beijing' (region ID, e.g., cn-beijing), and 'instance_ids' as 'ECS实例ID列表' (ECS instance ID list). With schema description coverage at 0%, this compensates somewhat by explaining what the parameters represent. However, it doesn't provide details like format constraints, example values beyond one region, or how multiple instance IDs are handled, keeping it at a baseline level.

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 tool's purpose: '获取ECS实例磁盘使用率数据' (Get ECS instance disk usage data). It specifies the verb '获取' (get) and resource 'ECS实例磁盘使用率数据' (ECS instance disk usage data), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_cpu_usage_data' or 'get_memory_usage_data' beyond the resource type, which prevents a perfect score.

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 sibling tools like 'get_cpu_usage_data' or 'get_memory_usage_data' for different metrics, or 'describe_ecs_instances' for general instance info. There's no context on prerequisites, such as needing instance IDs from another tool, or exclusions like unsupported instance types.

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