Skip to main content
Glama
RadiumGu

Alibaba Cloud Operations MCP Server

by RadiumGu

delete_oss_bucket

Remove an OSS storage bucket from Alibaba Cloud to manage storage resources and reduce costs. Specify the bucket name and region for deletion.

Instructions

删除OSS存储桶

Args:
    bucket_name: 存储桶名称
    region: 区域ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucket_nameYes
regionNocn-beijing

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler implementation for 'delete_oss_bucket'. It dynamically finds and invokes a low-level OSS delete tool from oss_tools.tools by matching 'delete' in the function name.
    @app.tool()
    def delete_oss_bucket(bucket_name: str, region: str = "cn-beijing") -> str:
        """删除OSS存储桶
        
        Args:
            bucket_name: 存储桶名称
            region: 区域ID
        """
        try:
            sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'alibaba_cloud_ops_mcp_server'))
            from tools import oss_tools
            
            # 查找删除存储桶的工具
            for tool_func in oss_tools.tools:
                if hasattr(tool_func, '__name__') and 'delete' in tool_func.__name__.lower():
                    result = tool_func(BucketName=bucket_name, RegionId=region)
                    return f"✅ 成功删除OSS存储桶: {bucket_name}"
            
            return f"OSS存储桶删除功能可用,桶名: {bucket_name}"
        except Exception as e:
            return f"OSS存储桶删除失败: {str(e)}"
  • Low-level helper function OSS_DeleteBucket that performs the actual Alibaba Cloud OSS delete_bucket API call. This is the function invoked by the handler.
    @tools.append
    def OSS_DeleteBucket(
        BucketName: str = Field(description='AlibabaCloud OSS Bucket Name'),
        RegionId: str = Field(description='AlibabaCloud region ID', default='cn-hangzhou')
    ):
        """删除指定的OSS存储空间。"""
        client = create_client(region_id=RegionId)
        result = client.delete_bucket(oss.DeleteBucketRequest(bucket=BucketName))
        return result.__str__()
  • Alternative low-level helper function OSS_DeleteBucket (earlier version) that also performs the OSS delete_bucket call and is available in oss_tools.tools.
    @tools.append
    def OSS_DeleteBucket(
        BucketName: str,
        RegionId: str = 'cn-hangzhou'
    ):
        """删除OSS存储空间。"""
        if not BucketName:
            return "存储桶名称不能为空"
            
        try:
            client = create_client(region_id=RegionId)
            request = oss.DeleteBucketRequest(bucket=BucketName)
            result = client.delete_bucket(request)
            return f"存储桶 {BucketName} 删除成功"
        except Exception as e:
            return f"删除存储桶失败: {str(e)}"
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While '删除' clearly indicates a destructive operation, it doesn't mention critical behavioral aspects like whether deletion is permanent, requires specific permissions, has rate limits, or what happens to contained objects. The description lacks essential context for a destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief but not optimally structured. The main purpose is stated in one line, followed by parameter translations. While concise, it could be more front-loaded with critical behavioral information for a destructive operation. The parameter section adds some value but could be integrated more efficiently.

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?

For a destructive tool with 2 parameters, 0% schema coverage, no annotations, but with an output schema, the description is inadequate. It doesn't address the destructive nature sufficiently, provides minimal parameter guidance, and fails to give context about when this operation is appropriate versus dangerous. The output schema existence reduces but doesn't eliminate the need for more complete description.

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 0%, so the description must compensate. It provides Chinese translations of parameter names ('存储桶名称' for bucket_name, '区域ID' for region) but adds minimal semantic context beyond what's obvious from the parameter names. The description doesn't explain format requirements, constraints, or the significance of the default region value.

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 action ('删除' meaning delete) and resource ('OSS存储桶' meaning OSS bucket), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'list_oss_buckets' or 'create_oss_bucket' beyond the obvious action difference.

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's no mention of prerequisites (e.g., bucket must be empty), consequences, or when to choose other tools like 'list_oss_buckets' for verification first.

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