Skip to main content
Glama

set_bucket_policy

Configure access permissions for a MinIO storage bucket by defining a JSON policy. Manage and enforce security rules for bucket-level operations.

Instructions

设置存储桶策略

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bucketNameYes存储桶名称
policyYesJSON格式的策略

Implementation Reference

  • Handler for 'set_bucket_policy' tool: validates input with Zod, calls MinIO client to set policy, returns success message.
    case 'set_bucket_policy': { const { bucketName, policy } = z.object({ bucketName: z.string(), policy: z.string() }).parse(args); await this.minioClient.setBucketPolicy(bucketName, policy); return { content: [ { type: 'text', text: `成功设置存储桶 ${bucketName} 的策略` } ] };
  • src/index.ts:278-289 (registration)
    Tool registration in list_tools response, including name, description, and JSON schema for input validation.
    { name: 'set_bucket_policy', description: '设置存储桶策略', inputSchema: { type: 'object', properties: { bucketName: { type: 'string', description: '存储桶名称' }, policy: { type: 'string', description: 'JSON格式的策略' } }, required: ['bucketName', 'policy'] } },
  • Zod schema validation for tool arguments in the handler.
    const { bucketName, policy } = z.object({ bucketName: z.string(), policy: z.string() }).parse(args);
  • MinIOStorageClient helper method that ensures connection and delegates to underlying MinIO Client's setBucketPolicy.
    async setBucketPolicy(bucketName: string, policy: string): Promise<void> { this.ensureConnected(); await this.client!.setBucketPolicy(bucketName, policy); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pickstar-2002/minio-storage-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server