Skip to main content
Glama

AlibabaCloud MCP Server

Official
by aliyun

DeleteBucket

Remove AlibabaCloud OSS buckets efficiently by specifying the region and bucket name. Simplify storage management on AlibabaCloud MCP Server.

Instructions

删除指定的OSS存储空间。

Input Schema

NameRequiredDescriptionDefault
BucketNameYesAlibabaCloud OSS Bucket Name
RegionIdNoAlibabaCloud region IDcn-hangzhou

Input Schema (JSON Schema)

{ "properties": { "BucketName": { "description": "AlibabaCloud OSS Bucket Name", "title": "Bucketname", "type": "string" }, "RegionId": { "default": "cn-hangzhou", "description": "AlibabaCloud region ID", "title": "Regionid", "type": "string" } }, "required": [ "BucketName" ], "title": "DeleteBucketArguments", "type": "object" }

Implementation Reference

  • The handler function implementing the DeleteBucket tool logic by calling the Alibaba Cloud OSS client's delete_bucket method.
    @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__()
  • Registers all tools from oss_tools module (including OSS_DeleteBucket) to the FastMCP server.
    for tool in oss_tools.tools: mcp.tool(tool)
  • Helper function to create an authenticated OSS client used by the DeleteBucket handler.
    def create_client(region_id: str) -> oss.Client: credentials_provider = CredentialsProvider() cfg = oss.config.load_default() cfg.user_agent = 'alibaba-cloud-ops-mcp-server' cfg.credentials_provider = credentials_provider cfg.region = region_id return oss.Client(cfg)
  • Pydantic schema definitions for the input parameters of the DeleteBucket tool.
    BucketName: str = Field(description='AlibabaCloud OSS Bucket Name'), RegionId: str = Field(description='AlibabaCloud region ID', default='cn-hangzhou')
  • Appends the OSS_DeleteBucket function to the tools list for later registration.
    @tools.append

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-core-mcp-server'

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