list_buckets
Retrieve all storage buckets from MinIO object storage to view available containers for data management and organization.
Instructions
列出所有存储桶
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_buckets"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:334-344 (handler)MCP tool handler for 'list_buckets': calls minioClient.listBuckets() and returns formatted text response with bucket names and creation dates.
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-86 (registration)Registration of the 'list_buckets' tool in the ListTools response, including name, description, and empty input schema.
{ name: 'list_buckets', description: '列出所有存储桶', inputSchema: { type: 'object', properties: {} } - src/minio-client.ts:45-52 (helper)Core implementation of listBuckets in MinIOStorageClient: ensures connection, lists buckets via MinIO client, maps to BucketInfo array.
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 in listBuckets return type.
export interface BucketInfo { name: string; creationDate: Date; }