Skip to main content
Glama
RadiumGu

Alibaba Cloud Operations MCP Server

by RadiumGu

describe_vswitches

Query and list available vSwitches in Alibaba Cloud VPCs to manage network segmentation and connectivity.

Instructions

查询交换机列表

Args:
    region: 区域ID,如cn-beijing
    vpc_id: VPC ID(可选)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionNocn-beijing
vpc_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary handler and registration for the 'describe_vswitches' tool. It is a wrapper that searches for and invokes a vswitch-related function from common_api_tools.tools, passing RegionId and optional VpcId.
    @app.tool()
    def describe_vswitches(region: str = "cn-beijing", vpc_id: Optional[str] = None) -> str:
        """查询交换机列表
        
        Args:
            region: 区域ID,如cn-beijing
            vpc_id: VPC ID(可选)
        """
        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 'vswitch' in tool_func.__name__.lower():
                    kwargs = {'RegionId': region}
                    if vpc_id:
                        kwargs['VpcId'] = vpc_id
                    result = tool_func(**kwargs)
                    return str(result)
            
            return f"交换机查询功能可用,查询region: {region}"
        except Exception as e:
            return f"交换机查询失败: {str(e)}"
  • Configuration defining the 'DescribeVSwitches' API for the VPC service, used to dynamically generate the underlying API tool implementation.
    'Vpc': [
        'DescribeVpcs',
        'DescribeVSwitches'
    ],
  • Invocation of create_api_tools which uses the config to generate and register dynamic tool functions, including one for DescribeVSwitches.
    api_tools.create_api_tools(mcp, config)
  • Dynamic tool generator that creates FastMCP tools for each API in config, such as VPC_DESCRIBEVSWITCHES, which provides the core API call logic via _tools_api_call.
    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)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It only states it's a query operation, but doesn't disclose behavioral traits like authentication requirements, rate limits, pagination behavior, error conditions, or what happens when vpc_id is omitted. For a tool with no annotation coverage, this is insufficient.

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 and well-structured: a single sentence stating the purpose followed by a clear parameter explanation section. Every sentence earns its place with no wasted words, and the information is front-loaded appropriately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which handles return values), 2 parameters with 0% schema coverage, and no annotations, the description provides adequate basic purpose and parameter semantics. However, it lacks behavioral context needed for a query tool with no annotations, making it minimally complete but with clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides clear semantic meaning for both parameters: 'region' as region ID with an example (cn-beijing) and 'vpc_id' as VPC ID with indication it's optional. With 0% schema description coverage, this compensates well by explaining what each parameter represents, though it doesn't specify format constraints beyond the example.

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 states '查询交换机列表' (query switch list), which clearly indicates the tool's purpose as retrieving a list of vSwitches. It specifies the resource (vSwitches) and action (query/list), but doesn't differentiate from siblings like describe_vpcs or describe_ecs_instances beyond the resource type.

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 about when to use this tool versus alternatives. The description doesn't mention sibling tools like describe_vpcs or describe_ecs_instances, nor does it specify any prerequisites, constraints, or appropriate contexts for using this tool.

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

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/RadiumGu/alicloud-ops-mcp'

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