Skip to main content
Glama
aliyun

Alibaba Cloud MCP Server

Official
by aliyun

GetCpuloadavg5mData

Retrieve CPU load average data over 5 minutes for Alibaba Cloud ECS instances to monitor performance and identify resource bottlenecks, using specified region and instance IDs.

Instructions

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

Input Schema

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

Implementation Reference

  • Handler function CMS_GetCpuloadavg5mData (tool name 'CMS_GetCpuloadavg5mData') that retrieves the 5-minute CPU load average metric data from Alibaba Cloud CMS for given ECS instance IDs.
    @tools.append
    def CMS_GetCpuloadavg5mData(
        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_5m')
  • Helper function that creates a CMS client, prepares dimensions for ECS instances, queries the last metric value for the specified metric_name (e.g., 'load_5m'), and returns the datapoints.
    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
  • Registers all tools from cms_tools.tools (including CMS_GetCpuloadavg5mData) to the FastMCP server instance.
    for tool in cms_tools.tools:
        mcp.tool(tool)
  • Pydantic schema definition for the tool inputs: InstanceIds (list of ECS instance IDs) and RegionId (Alibaba Cloud region, default 'cn-hangzhou').
    def CMS_GetCpuloadavg5mData(
        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_5m')
  • Helper function to create the Alibaba Cloud CMS client configured for the given 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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states what the tool does ('get data') without describing the return format (e.g., structured data, error handling), whether it's a read-only operation (implied but not explicit), or any rate limits or authentication requirements. This is inadequate for a tool with no annotation coverage.

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, concise sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and efficiently communicates the core functionality, making it easy to parse quickly.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what the returned data looks like (e.g., format, units), potential errors, or how it differs from sibling tools. For a data-fetching tool in a cloud environment, this leaves significant gaps in understanding its full behavior and usage context.

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 doesn't add any parameter-specific information beyond what's in the schema, which has 100% coverage. The schema already describes InstanceIds as a list of AlibabaCloud ECS instance IDs and RegionId with a default value. Since schema coverage is high, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 the resource ('CPU五分钟平均负载指标数据' meaning 'CPU five-minute average load metric data'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from siblings like GetCpuloadavg15mData or GetCpuLoadavgData, which appear to be similar metrics with different timeframes.

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 on when to use this tool versus alternatives. The description doesn't mention sibling tools like GetCpuloadavg15mData (15-minute average) or GetCpuLoadavgData (general load), nor does it specify prerequisites such as needing instance IDs or appropriate permissions.

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