get_bucket_policy
Retrieve access policies for MinIO storage buckets to manage permissions and security settings.
Instructions
获取存储桶策略
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bucketName | Yes | 存储桶名称 |
Implementation Reference
- src/index.ts:611-625 (handler)The handler logic for the 'get_bucket_policy' tool. Validates bucketName input with Zod, calls MinIOStorageClient.getBucketPolicy, and formats the policy as a text response in the MCP content.case 'get_bucket_policy': { const { bucketName } = z.object({ bucketName: z.string() }).parse(args); const policy = await this.minioClient.getBucketPolicy(bucketName); return { content: [ { type: 'text', text: `存储桶 ${bucketName} 的策略:\n${policy}` } ] }; }
- src/index.ts:290-300 (registration)Registration of the 'get_bucket_policy' tool in the ListTools response, including name, description, and input schema definition.{ name: 'get_bucket_policy', description: '获取存储桶策略', inputSchema: { type: 'object', properties: { bucketName: { type: 'string', description: '存储桶名称' } }, required: ['bucketName'] } },
- src/minio-client.ts:337-340 (helper)Helper method in MinIOStorageClient class that ensures connection and delegates to the underlying MinIO client's getBucketPolicy method.async getBucketPolicy(bucketName: string): Promise<string> { this.ensureConnected(); return await this.client!.getBucketPolicy(bucketName); }