Skip to main content
Glama
aliyun

AlibabaCloud MCP Server

Official
by aliyun

GetMemUsedData

Retrieve memory usage metrics for AlibabaCloud ECS instances to monitor resource utilization and optimize performance.

Instructions

获取内存使用量指标数据

Input Schema

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

Implementation Reference

  • Handler function for the 'CMS_GetMemUsedData' tool. It calls the helper to get 'memory_usedspace' metric data from Alibaba Cloud CMS for specified ECS instances.
    @tools.append
    def CMS_GetMemUsedData(
        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_usedspace')
  • Helper function that performs the actual API call to Alibaba Cloud CMS to retrieve the last metric data points for given instances and metric.
    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_GetMemUsedData) with the FastMCP server instance.
    for tool in cms_tools.tools:
        mcp.tool(tool)
  • Decorator that appends the CMS_GetMemUsedData function to the cms_tools.tools list for later registration.
    @tools.append
  • Pydantic Field definitions providing input schema and descriptions for the tool parameters.
    InstanceIds: List[str] = Field(description='AlibabaCloud ECS instance ID List'),
    RegionId: str = Field(description='AlibabaCloud region ID', default='cn-hangzhou')
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 states the action ('get') but doesn't describe what the tool returns (e.g., format, units, time range), whether it's a read-only operation, potential rate limits, or authentication needs. This leaves significant gaps in understanding how the tool behaves beyond its basic purpose.

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 in Chinese that directly states the tool's purpose without any unnecessary words or fluff. It is front-loaded and appropriately sized for a simple data retrieval tool, 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 tool's complexity (data retrieval with parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't explain the return values (e.g., what 'memory usage metric data' includes), potential errors, or behavioral traits like whether it's safe or has side effects. This leaves the agent with insufficient context to use the tool effectively beyond basic parameter input.

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 schema description coverage is 100%, with clear descriptions for both parameters (InstanceIds and RegionId). The description adds no additional parameter semantics beyond what the schema provides, such as explaining what 'memory usage metric data' entails or how parameters affect the output. This meets the baseline score since the schema adequately documents the parameters.

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 verb ('获取' meaning 'get') and resource ('内存使用量指标数据' meaning 'memory usage metric data'), making the purpose understandable. However, it doesn't explicitly distinguish this tool from its sibling 'GetMemUsageData', which appears to be a related memory metric tool, leaving some ambiguity about their differentiation.

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 like 'GetMemUsageData' or other memory-related tools. It lacks context about prerequisites, such as needing instance IDs or region specifications, and offers no exclusions or recommendations for when not 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

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/alibaba-cloud-ops-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server