Skip to main content
Glama

set_bucket_policy

Destructive

Replace a MinIO bucket's access policy with a new JSON document, with dry-run preview and rollback to the prior policy.

Instructions

[WRITE][risk=medium] Replace the bucket policy. Reversible → prior policy JSON.

An anonymous-Allow policy makes the bucket public — check bucket_exposure_audit after changing policies.

Refuses a policy whose explicit Deny on s3:PutBucketPolicy covers this tool's own access key: an explicit Deny beats every Allow, so the undo that replays the prior policy would itself be denied. Enforced under dry_run too.

Args: bucket_name: Bucket name (from bucket_ls). policy_json: Full policy document as a JSON string (must contain 'Statement'). dry_run: If True, preview without applying. target: MinIO target name from config; omit for the default.

Input Schema

NameRequiredDescriptionDefault
targetNo
dry_runNo
bucket_nameYes
policy_jsonYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.0

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations by disclosing that the prior policy JSON is returned for undo, that an anonymous-Allow policy exposes the bucket, and a non-obvious refusal rule (an explicit Deny on s3:PutBucketPolicy covering the tool's own access key blocks the call, even under dry_run) with the reasoning that an explicit Deny beats every Allow. This is exactly the kind of hidden behavior an agent needs before invoking a risky write.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the operation tag and a one-line effect/reversibility statement, then an Args block. The refusal paragraph is longer than typical but each sentence adds non-obvious safety information, so it largely earns its space.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutating, non-idempotent tool with no output schema, the description covers safety, reversibility, side effects on bucket exposure, refusal conditions, and every parameter. An agent has everything needed to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden and does so: bucket_name is sourced ('from bucket_ls'), policy_json is constrained ('must contain Statement'), dry_run is explained as preview-only, and target is tied to config with a default. All four parameters are documented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Replace the bucket policy') and immediately disambiguates from the read/delete siblings (bucket_policy_get, delete_bucket_policy) by naming the mutation and its reversibility. The [WRITE][risk=medium] tag front-loads the operation class.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear operational context: use dry_run to preview, and run bucket_exposure_audit after changing policies because an anonymous-Allow policy makes the bucket public. It does not explicitly contrast with delete_bucket_policy or bucket_lock_config, but the when-to-use conditions are well established.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.