bucket_exists
Check if a MinIO storage bucket exists by verifying its name. Use this tool to validate bucket availability before performing storage operations.
Instructions
检查存储桶是否存在
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bucketName | Yes | 存储桶名称 |
Implementation Reference
- src/index.ts:379-393 (handler)MCP tool handler for 'bucket_exists': validates input using Zod, calls MinIOStorageClient.bucketExists(), and returns a text response indicating whether the bucket exists.case 'bucket_exists': { const { bucketName } = z.object({ bucketName: z.string() }).parse(args); const exists = await this.minioClient.bucketExists(bucketName); return { content: [ { type: 'text', text: `存储桶 ${bucketName} ${exists ? '存在' : '不存在'}` } ] }; }
- src/index.ts:111-121 (registration)Registration of the 'bucket_exists' tool in the ListTools response, including name, description, and JSON input schema.{ name: 'bucket_exists', description: '检查存储桶是否存在', inputSchema: { type: 'object', properties: { bucketName: { type: 'string', description: '存储桶名称' } }, required: ['bucketName'] } },
- src/minio-client.ts:73-76 (helper)Implementation of bucketExists method in MinIOStorageClient class, which ensures connection and delegates to MinIO client's bucketExists method.async bucketExists(bucketName: string): Promise<boolean> { this.ensureConnected(); return await this.client!.bucketExists(bucketName); }