Skip to main content
Glama

s3_set_bucket_policy

Change an S3 bucket policy by replacing the full policy JSON or toggling a managed public GetObject grant while preserving other statements; confirm provider, bucket, actions, and scope first.

Instructions

Change an S3 bucket policy. ALWAYS confirm with the user before calling, including the provider, bucket, actions and object scope. Supply a full policy_json replacement or toggle the managed public GetObject grant with public_read. The toggle preserves other statements. Anonymous mutations and wildcard Allow actions require allow_public_write=true.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "provider": "<provider>",
      "bucket": "<bucket>"
    },
    "name": "s3_set_bucket_policy"
  }
}

Input Schema

NameRequiredDescriptionDefault
bucketYesBucket name.
regionNoBucket region. Omit for automatic resolution or a fixed endpoint.
accountNoAccount label of the provider whose object storage to use; omit for that provider's default account.
providerYes
policy_jsonNoComplete replacement policy as JSON.
public_readNoAdd or remove the managed public GetObject grant for all keys.
allow_public_writeNoPermit broad or anonymous write grants after explicit user confirmation.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.35.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the mandatory confirmation step, that the toggle preserves other statements, and that anonymous mutations or wildcard Allow actions need allow_public_write=true. It omits IAM/permission requirements and what a partial failure leaves behind, but the destructive-replacement nature is made clear.

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

Conciseness5/5

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

Three tight sentences: the operation first, then the confirmation rule, then the two modes and the safety gate. No filler, and the most important constraint (confirm first) is front-loaded.

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 7-parameter mutation tool with no annotations and no output schema, the description covers the safety-critical behaviors an agent needs: confirmation, replacement vs toggle semantics, statement preservation, and the public-write gate. Return values aren't described, but that's acceptable given no output schema and a state-changing action.

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

Parameters4/5

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

Schema coverage is already 86%, yet the description still adds real meaning: policy_json is a complete replacement (not a merge), public_read targets the managed public GetObject grant for all keys and preserves other statements, and allow_public_write gates anonymous/wildcard writes. That is more than the schema's one-line parameter descriptions convey.

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 ('Change an S3 bucket policy') and the sibling s3_get_bucket_policy makes the read/write split obvious without opening either schema.

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?

It mandates confirming with the user first (naming provider, bucket, actions, object scope) and gives a clear either/or between a full policy_json replacement and the public_read toggle. It doesn't contrast with siblings like s3_get_bucket_policy, but the when-to-use context for the two modes is explicit.

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