Skip to main content
Glama
aliyun

Alibaba Cloud MCP Server

Official
by aliyun

GetMemUsageData

Retrieve memory utilization metrics for specified Alibaba Cloud ECS instances to monitor performance and optimize resource allocation efficiently.

Instructions

获取内存利用率指标数据

Input Schema

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

Implementation Reference

  • Handler function implementing the GetMemUsageData tool (named CMS_GetMemUsageData), which retrieves memory utilization metrics from Alibaba Cloud CMS for given ECS instance IDs.
    @tools.append
    def CMS_GetMemUsageData(
        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, 'memory_usedutilization')
  • Core helper function that performs the actual API call to Alibaba Cloud CMS to fetch metric data (e.g., memory_usedutilization for GetMemUsageData).
    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
  • MCP server registration loop that adds all tools from cms_tools.tools (including CMS_GetMemUsageData) to the FastMCP server instance.
    for tool in cms_tools.tools:
        mcp.tool(tool)
  • Module-level registration decorator that appends the CMS_GetMemUsageData handler to the cms_tools.tools list, which is later registered in server.py.
    @tools.append
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. While '获取' (get) implies a read operation, the description doesn't disclose important behavioral traits like authentication requirements, rate limits, whether this is a real-time or historical query, what time range the data covers, or what format the response takes. For a monitoring tool with zero annotation coverage, this is inadequate.

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 extremely concise with just one phrase ('获取内存利用率指标数据'). While it could benefit from more detail, every word in this description earns its place by communicating the core purpose without any waste or redundancy.

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 cloud monitoring tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns, how the data is formatted, whether it's real-time or historical, what time periods are available, or any behavioral characteristics. For a tool that presumably returns time-series metric data, this leaves significant gaps.

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 documents both parameters thoroughly. The description adds no additional parameter information beyond what's in the schema. According to scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 as '获取内存利用率指标数据' (Get memory utilization metric data), which is a specific verb+resource combination. It distinguishes from some siblings like GetMemUsedData (which likely returns memory used rather than utilization), but doesn't explicitly differentiate from all similar 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. There are multiple sibling tools for monitoring different metrics (CPU usage, disk usage, etc.), but the description doesn't indicate when memory utilization data is needed versus other metrics or when this tool is appropriate versus other memory-related tools.

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