osc_list_buckets
Retrieve a list of all buckets from a specified Minio instance on Eyevinn Open Source Cloud Storage.
Instructions
List all buckets on Eyevinn Open Source Cloud Storage (OSC) Minio instance
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the minio instance |
Implementation Reference
- src/tools/osc.ts:108-127 (handler)Handler for osc_list_buckets tool: parses args, gets MinIO instance, calls listBuckets() helper, and returns bucket names as text content.
case 'osc_list_buckets': { const args = ListBucketsSchema.parse(request.params.arguments); const instance = await getMinioInstance(context, args.name); if (!instance) { throw new Error(`Minio instance with name ${args.name} not found`); } const buckets = await listBuckets(args.name, context); return { content: [ { type: 'text', text: `Buckets on MinIO instance '${args.name}':` } ].concat( buckets.map((bucket) => ({ type: 'text', text: bucket })) ) }; - src/tools/osc.ts:200-210 (helper)Helper function that retrieves a MinIO instance and delegates to listMinioBuckets from the minio_minio resource module.
export async function listBuckets(name: string, context: Context) { const instance = await getMinioInstance(context, name); if (!instance) { throw new Error(`Minio instance with name ${name} not found`); } return await listMinioBuckets( instance.endpoint, instance.accessKeyId, instance.secretAccessKey ); } - src/resources/minio_minio.ts:155-168 (helper)Low-level helper that creates a Minio client and calls the minio SDK's listBuckets() to retrieve all bucket names.
export async function listMinioBuckets( endpoint: string, accessKeyId: string, secretAccessKey: string ): Promise<string[]> { const minioClient = new Minio.Client({ endPoint: new URL(endpoint).hostname, accessKey: accessKeyId, secretKey: secretAccessKey }); const buckets = await minioClient.listBuckets(); return buckets.map((bucket) => bucket.name); } - src/schemas.ts:35-41 (schema)Zod schema for osc_list_buckets input: requires a 'name' string matching /^[a-z0-9]+$/ (the MinIO instance name).
export const ListBucketsSchema = z.object({ name: z .string() .regex(/^[a-z0-9]+$/) .describe('Name of the minio instance') }); export type ListBucketsSchema = z.infer<typeof ListBucketsSchema>; - src/tools/osc.ts:39-44 (registration)Registration of osc_list_buckets tool in the listOscTools() function, which is called from index.ts to register with MCP server.
{ name: 'osc_list_buckets', description: 'List all buckets on Eyevinn Open Source Cloud Storage (OSC) Minio instance', inputSchema: zodToJsonSchema(ListBucketsSchema) }