describe_vpcs
Retrieve and list Virtual Private Cloud (VPC) configurations in Alibaba Cloud to manage network resources and monitor infrastructure.
Instructions
查询VPC列表
Args:
region: 区域ID,如cn-beijing
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | cn-beijing |
Implementation Reference
- complete_fastmcp_server.py:165-183 (handler)The handler function decorated with @app.tool() that implements the describe_vpcs tool. It dynamically imports common_api_tools and searches for a tool function containing 'vpc' in its name to delegate the RegionId call, or returns an availability message.@app.tool() def describe_vpcs(region: str = "cn-beijing") -> str: """查询VPC列表 Args: region: 区域ID,如cn-beijing """ try: sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'alibaba_cloud_ops_mcp_server')) from tools import common_api_tools for tool_func in common_api_tools.tools: if hasattr(tool_func, '__name__') and 'vpc' in tool_func.__name__.lower(): result = tool_func(RegionId=region) return str(result) return f"VPC查询功能可用,查询region: {region}" except Exception as e: return f"VPC查询失败: {str(e)}"
- Configuration listing the DescribeVpcs API under the Vpc service, likely used to dynamically generate tool functions in api_tools.create_api_tools.'Vpc': [ 'DescribeVpcs', 'DescribeVSwitches'
- alibaba_cloud_ops_mcp_server/server.py:70-70 (registration)Calls create_api_tools with the config to register dynamic API tools, including VPC_DESCRIBE_VPCS (note: different name from describe_vpcs).api_tools.create_api_tools(mcp, config)
- Function that dynamically creates and registers MCP tools for each API in the config, naming them like 'VPC_DESCRIBE_VPCS'. The describe_vpcs might be a wrapper or alias.def create_api_tools(mcp: FastMCP, config:dict): for service_code, apis in config.items(): for api_name in apis: _create_and_decorate_tool(mcp, service_code, api_name)