create_bucket
Create storage buckets in MinIO object storage to organize and manage data. Specify bucket name and optional region for structured data storage.
Instructions
创建存储桶
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"bucketName": "<bucketName>"
},
"name": "create_bucket"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bucketName | Yes | 存储桶名称 | |
| region | No | 区域设置(可选) |
Implementation Reference
- src/index.ts:346-361 (handler)Handler for the 'create_bucket' tool. Parses arguments using Zod, calls minioClient.createBucket, and returns a success message.
case 'create_bucket': { const { bucketName, region } = z.object({ bucketName: z.string(), region: z.string().optional() }).parse(args); await this.minioClient.createBucket(bucketName, region); return { content: [ { type: 'text', text: `成功创建存储桶: ${bucketName}` } ] }; } - src/index.ts:88-99 (registration)Registration of the 'create_bucket' tool in the list_tools response, including name, description, and input schema.
{ name: 'create_bucket', description: '创建存储桶', inputSchema: { type: 'object', properties: { bucketName: { type: 'string', description: '存储桶名称' }, region: { type: 'string', description: '区域设置(可选)' } }, required: ['bucketName'] } }, - src/index.ts:347-350 (schema)Zod schema validation for create_bucket inputs within the handler.
const { bucketName, region } = z.object({ bucketName: z.string(), region: z.string().optional() }).parse(args); - src/minio-client.ts:57-60 (helper)Helper method in MinIOStorageClient that performs the actual bucket creation using the MinIO client's makeBucket method.
async createBucket(bucketName: string, region?: string): Promise<void> { this.ensureConnected(); await this.client!.makeBucket(bucketName, region || this.config!.region || 'us-east-1'); }