Skip to main content
Glama
aliyun

AlibabaCloud MCP Server

Official
by aliyun

PutBucket

Create and configure a new OSS storage bucket in AlibabaCloud with options for region, storage class, and data redundancy type for efficient resource management.

Instructions

创建一个新的OSS存储空间。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
BucketNameYesAlibabaCloud OSS Bucket Name
DataRedundancyTypeNoThe data disaster recovery type of AlibabaCloud OSS Bucket, LRS (default): Locally redundant LRS, which stores your data redundantly on different storage devices in the same availability zone. ZRS: Intra-city redundant ZRS, which uses a multi-availability zone (AZ) mechanism to store your data redundantly in three availability zones in the same region.LRS
RegionIdNoAlibabaCloud region IDcn-hangzhou
StorageClassNoThe Storage Type of AlibabaCloud OSS Bucket, The value range is as follows: Standard (default): standard storage, IA: infrequent access, Archive: archive storage, ColdArchive: cold archive storage, DeepColdArchive: deep cold archive storageStandard

Implementation Reference

  • Handler function for the OSS_PutBucket tool. Creates a new OSS bucket using the Alibaba Cloud OSS SDK with specified parameters for region, storage class, and data redundancy.
    @tools.append
    def OSS_PutBucket(
        BucketName: str = Field(description='AlibabaCloud OSS Bucket Name'),
        RegionId: str = Field(description='AlibabaCloud region ID', default='cn-hangzhou'),
        StorageClass: str = Field(description='The Storage Type of AlibabaCloud OSS Bucket, The value range is as follows: '
                                              'Standard (default): standard storage, '
                                              'IA: infrequent access, Archive: archive storage, '
                                              'ColdArchive: cold archive storage, '
                                              'DeepColdArchive: deep cold archive storage', default='Standard'),
        DataRedundancyType: str = Field(description='The data disaster recovery type of AlibabaCloud OSS Bucket, '
                                                    'LRS (default): Locally redundant LRS, which stores your data '
                                                    'redundantly on different storage devices in the same availability zone. '
                                                    'ZRS: Intra-city redundant ZRS, which uses a multi-availability zone '
                                                    '(AZ) mechanism to store your data redundantly in three availability '
                                                    'zones in the same region.', default='LRS')
    ):
        """创建一个新的OSS存储空间。"""
        client = create_client(region_id=RegionId)
        result = client.put_bucket(oss.PutBucketRequest(
            bucket=BucketName,
            create_bucket_configuration=oss.CreateBucketConfiguration(
                storage_class=StorageClass,
                data_redundancy_type=DataRedundancyType
            )
        ))
        return result.__str__()
  • Registration of all OSS tools (including OSS_PutBucket) into the FastMCP server instance.
    for tool in oss_tools.tools:
        mcp.tool(tool)
  • Helper function to create an OSS client instance with credentials and region configuration, used by OSS_PutBucket.
    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)
  • Custom credentials provider class for OSS client, fetches credentials from headers or credential client.
    class CredentialsProvider(EnvironmentVariableCredentialsProvider):
        def __init__(self) -> None:
            credentials = get_credentials_from_header()
            if credentials:
                access_key_id = credentials.get('AccessKeyId', None)
                access_key_secret = credentials.get('AccessKeySecret', None)
                session_token = credentials.get('SecurityToken', None)
            else:
                credentialsClient = CredClient()
                access_key_id = credentialsClient.get_credential().access_key_id
                access_key_secret = credentialsClient.get_credential().access_key_secret
                session_token = credentialsClient.get_credential().security_token
    
            self._credentials = Credentials(
                access_key_id, access_key_secret, session_token)
    
        def get_credentials(self) -> Credentials:
            return self._credentials
  • Decorator that appends the OSS_PutBucket function to the local tools list for later registration.
    @tools.append
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 'creates' implies a write/mutation operation, it doesn't describe permissions required, whether the operation is idempotent, what happens on failure, or any rate limits. For a bucket creation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 a single, efficient sentence that states the core purpose without any wasted words. It's appropriately sized for a creation operation and gets straight to the point.

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 bucket creation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after creation, what permissions are needed, whether the bucket name must be globally unique, or what the response contains. The 100% schema coverage helps with parameters, but behavioral and operational context is missing.

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 100%, so the schema already documents all 4 parameters thoroughly with descriptions, defaults, and value explanations. The description adds no additional parameter information beyond what's in the schema, meeting the baseline expectation when schema does the heavy lifting.

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 ('创建一个新的' - creates a new) and resource ('OSS存储空间' - OSS storage space/bucket). It's specific about what the tool does, though it doesn't explicitly differentiate from sibling tools like ListBuckets or DeleteBucket in the description text itself.

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, when creation is appropriate versus listing existing buckets, or what happens if a bucket with the same name already exists. The sibling tool ListBuckets exists but isn't referenced.

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

Related 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/alibaba-cloud-ops-mcp-server'

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