Skip to main content
Glama
jneless
by jneless

tos_create_bucket

Create a storage bucket in Volcengine TOS with specified name and access control permissions for object storage management.

Instructions

创建 TOS 存储桶

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aclNo访问控制权限private
bucket_nameYes存储桶名称

Implementation Reference

  • The handler function for tos_create_bucket that extracts bucket_name and acl from arguments and calls tos_client.create_bucket with appropriate ACL.
    async def create_bucket(args: Dict[str, Any]) -> List[TextContent]:
        """创建存储桶"""
        bucket_name = args["bucket_name"]
        acl = args.get("acl", "private")
        
        try:
            tos_client.create_bucket(bucket_name, tos.ACLType.ACL_Private if acl == "private" 
                                           else tos.ACLType.ACL_Public_Read if acl == "public-read"
                                           else tos.ACLType.ACL_Public_Read_Write)
            return [TextContent(type="text", text=f"成功创建存储桶: {bucket_name}")]
        except Exception as e:
            return [TextContent(type="text", text=f"创建存储桶失败: {str(e)}")]
  • Input schema definition for the tos_create_bucket tool, specifying properties for bucket_name (required) and acl (optional with enum).
    inputSchema={
        "type": "object",
        "properties": {
            "bucket_name": {
                "type": "string",
                "description": "存储桶名称"
            },
            "acl": {
                "type": "string",
                "description": "访问控制权限",
                "enum": ["private", "public-read", "public-read-write"],
                "default": "private"
            }
        },
        "required": ["bucket_name"]
    }
  • Tool registration in list_tools() function, defining the tos_create_bucket tool's name, description, and schema.
    Tool(
        name="tos_create_bucket",
        description="创建 TOS 存储桶",
        inputSchema={
            "type": "object",
            "properties": {
                "bucket_name": {
                    "type": "string",
                    "description": "存储桶名称"
                },
                "acl": {
                    "type": "string",
                    "description": "访问控制权限",
                    "enum": ["private", "public-read", "public-read-write"],
                    "default": "private"
                }
            },
            "required": ["bucket_name"]
        }
    ),
  • Dispatch logic in call_tool() that routes tos_create_bucket calls to the create_bucket handler.
    if name == "tos_create_bucket":
        return await create_bucket(arguments)

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/jneless/tos-mcp'

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