delete_bucket_policy
Remove bucket policies from MinIO object storage to manage access control. Use this tool to delete policies associated with specific buckets for streamlined permissions management.
Instructions
删除存储桶策略
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bucketName | Yes | 存储桶名称 |
Implementation Reference
- src/minio-client.ts:342-348 (handler)Core handler function that implements the deletion of bucket policy by setting an empty policy string using the MinIO client./** * 删除存储桶策略 */ async deleteBucketPolicy(bucketName: string): Promise<void> { this.ensureConnected(); await this.client!.setBucketPolicy(bucketName, ''); }
- src/index.ts:627-641 (handler)MCP tool handler in the switch statement that parses input arguments, calls the MinIO client method, and formats the response.case 'delete_bucket_policy': { const { bucketName } = z.object({ bucketName: z.string() }).parse(args); await this.minioClient.deleteBucketPolicy(bucketName); return { content: [ { type: 'text', text: `成功删除存储桶 ${bucketName} 的策略` } ] }; }
- src/index.ts:301-311 (registration)Tool registration in the listTools response, defining the tool name, description, and input schema.{ name: 'delete_bucket_policy', description: '删除存储桶策略', inputSchema: { type: 'object', properties: { bucketName: { type: 'string', description: '存储桶名称' } }, required: ['bucketName'] } }
- src/index.ts:628-630 (schema)Zod schema validation for tool input arguments in the handler.const { bucketName } = z.object({ bucketName: z.string() }).parse(args);