Skip to main content
Glama
aliyun

Alibaba Cloud MCP Server

Official
by aliyun

GetCpuLoadavgData

Monitor CPU load average data for Alibaba Cloud ECS instances, enabling efficient resource management and performance analysis using specified region and instance IDs.

Instructions

获取CPU一分钟平均负载指标数据

Input Schema

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

Implementation Reference

  • The handler function for the CMS_GetCpuLoadavgData tool. It uses Pydantic Fields for input schema validation and calls the helper to fetch CPU 1min load average metric data from Alibaba Cloud CMS for specified ECS instances in a region.
    @tools.append
    def CMS_GetCpuLoadavgData(
        InstanceIds: List[str] = Field(description='AlibabaCloud ECS instance ID List'),
        RegionId: str = Field(description='AlibabaCloud region ID', default='cn-hangzhou')
    ):
        """获取CPU一分钟平均负载指标数据"""
        return _get_cms_metric_data(RegionId, InstanceIds, 'load_1m')
  • Helper function shared among CMS metric tools to query the last datapoint for a given metric (e.g., 'load_1m' for CPU load avg) across multiple ECS instances using Alibaba Cloud CMS API.
    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)
        logger.info(f'CMS Tools response: {describe_metric_last_resp.body}')
        return describe_metric_last_resp.body.datapoints
  • Registration of all CMS tools (including CMS_GetCpuLoadavgData) by iterating over cms_tools.tools list and calling mcp.tool(tool) on the FastMCP server instance.
    for tool in cms_tools.tools:
        mcp.tool(tool)
  • Helper to create Alibaba Cloud CMS client configured for the metrics endpoint in the specified region.
    def create_client(region_id: str) -> cms20190101Client:
        config = create_config()
        config.endpoint = f'metrics.{region_id}.aliyuncs.com'
        return cms20190101Client(config)
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It only states what data is retrieved without mentioning authentication requirements, rate limits, error conditions, response format, or whether this is a real-time or historical metric. For a monitoring tool with zero annotation coverage, this leaves significant behavioral gaps.

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 that directly states the tool's purpose without unnecessary words. It's appropriately sized for a straightforward data retrieval tool and front-loads the essential 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 monitoring context, sibling tools with similar patterns, and no output schema, the description is incomplete. It doesn't explain what format the load average data returns (e.g., numeric values, timestamps, units), how multiple instances are handled, or whether this requires specific permissions. For a tool that presumably returns metric data, more context about the output would be helpful.

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 fully documents both parameters (InstanceIds and RegionId). The description adds no additional parameter information beyond what's in the schema. The baseline score of 3 reflects adequate coverage when the schema does the heavy lifting, though no value is added.

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 ('获取' meaning 'get') and resource ('CPU一分钟平均负载指标数据' meaning 'CPU one-minute average load metric data'), making the purpose immediately understandable. It distinguishes from some siblings like GetCpuloadavg15mData and GetCpuloadavg5mData by specifying the 1-minute timeframe, though it doesn't explicitly differentiate from other monitoring tools like GetCpuUsageData.

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 when this specific 1-minute load average is appropriate compared to 5-minute or 15-minute averages, nor does it explain how CPU load differs from CPU usage metrics available from sibling tools like GetCpuUsageData.

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