bucket_exists
Verify the existence of a specific bucket in MinIO object storage by providing the bucket name. Essential for managing storage operations and ensuring data organization.
Instructions
检查存储桶是否存在
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bucketName | Yes | 存储桶名称 |
Implementation Reference
- src/index.ts:379-393 (handler)Handler for the 'bucket_exists' MCP tool. Parses arguments using Zod, calls MinIOStorageClient.bucketExists(), and returns a text response indicating if 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 input schema.{ name: 'bucket_exists', description: '检查存储桶是否存在', inputSchema: { type: 'object', properties: { bucketName: { type: 'string', description: '存储桶名称' } }, required: ['bucketName'] } },
- src/minio-client.ts:73-76 (helper)Helper method in MinIOStorageClient that implements bucket existence check by calling the underlying MinIO client's bucketExists method.async bucketExists(bucketName: string): Promise<boolean> { this.ensureConnected(); return await this.client!.bucketExists(bucketName); }