list_buckets
Retrieve a comprehensive list of all available storage buckets in MinIO object storage using this tool, enabling efficient management and organization of stored data.
Instructions
列出所有存储桶
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:334-344 (handler)MCP tool handler implementation for 'list_buckets'. It calls MinioClient.listBuckets(), formats the list of buckets into a text response, and returns it in the MCP format.case 'list_buckets': { const buckets = await this.minioClient.listBuckets(); return { content: [ { type: 'text', text: `找到 ${buckets.length} 个存储桶:\n${buckets.map(b => `- ${b.name} (创建时间: ${b.creationDate.toISOString()})`).join('\n')}` } ] }; }
- src/index.ts:83-87 (registration)Registration of the 'list_buckets' tool with the MCP server, including name, Chinese description, and empty input schema (no parameters required).{ name: 'list_buckets', description: '列出所有存储桶', inputSchema: { type: 'object', properties: {} } },
- src/index.ts:86-86 (schema)Input schema for 'list_buckets' tool: empty object, indicating no input parameters are required.inputSchema: { type: 'object', properties: {} }
- src/minio-client.ts:45-52 (helper)Helper method in MinioClient class that lists all buckets using the MinIO SDK client.listBuckets(), ensures connection, and maps results to BucketInfo type.async listBuckets(): Promise<BucketInfo[]> { this.ensureConnected(); const buckets = await this.client!.listBuckets(); return buckets.map((bucket: any) => ({ name: bucket.name, creationDate: bucket.creationDate })); }
- src/types.ts:16-19 (schema)Type definition for BucketInfo, used as return type for listBuckets and in response formatting.export interface BucketInfo { name: string; creationDate: Date; }