Skip to main content
Glama

Alibaba Cloud MCP Server

Official
by aliyun

GetDiskTotalData

Retrieve total disk partition capacity data for Alibaba Cloud ECS instances using specified region and instance IDs, enabling resource monitoring and management.

Instructions

获取磁盘分区总容量指标数据

Input Schema

NameRequiredDescriptionDefault
InstanceIdsYesAlibabaCloud ECS instance ID List
RegionIdNoAlibabaCloud region IDcn-hangzhou

Input Schema (JSON Schema)

{ "properties": { "InstanceIds": { "description": "AlibabaCloud ECS instance ID List", "items": { "type": "string" }, "title": "Instanceids", "type": "array" }, "RegionId": { "default": "cn-hangzhou", "description": "AlibabaCloud region ID", "title": "Regionid", "type": "string" } }, "required": [ "InstanceIds" ], "title": "GetDiskTotalDataArguments", "type": "object" }

Implementation Reference

  • Handler function implementing the GetDiskTotalData tool logic (named CMS_GetDiskTotalData). It calls the helper to fetch 'diskusage_total' metric from Alibaba Cloud CMS for given ECS instance IDs.
    def CMS_GetDiskTotalData( 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_total')
  • Core helper function that performs the actual CMS API call to retrieve metric data (used by CMS_GetDiskTotalData and other CMS tools).
    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 loop that adds all CMS tools (including CMS_GetDiskTotalData) to the FastMCP server instance.
    for tool in cms_tools.tools: mcp.tool(tool)
  • Helper function to create the 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)
  • Import of the cms_tools module, which collects the tool functions in its 'tools' list.
    from alibaba_cloud_ops_mcp_server.tools import cms_tools, oos_tools, oss_tools, api_tools, common_api_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