b2_update_bucket
Update an existing Backblaze B2 bucket's persistent settings, including visibility, metadata, CORS rules, lifecycle, encryption, replication, Object Lock, and default retention, using the bucket ID.
Instructions
Update persistent settings on an existing B2 bucket: visibility, metadata, CORS, lifecycle, default encryption, replication, Object Lock, and default retention. Requires the writeBuckets capability. Use b2_list_buckets first to inspect the current bucketId/revision and use ifRevisionIs for safer retries; use s3_put_bucket_lifecycle only when you specifically need the S3 lifecycle API shape. Gated cases: bucketType allPublic, fileLockEnabled false, defaultRetention.mode null, lifecycleRules with daysFromHidingToDeleting, and any replicationConfiguration update.
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": {
"bucketId": "<bucketId>"
},
"name": "b2_update_bucket"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | Fallback confirmation for a gated bucket update when the effective server destructive policy is 'confirm' and MCP elicitation cannot run. Gated cases: bucketType allPublic, fileLockEnabled false, defaultRetention.mode null, lifecycleRules with daysFromHidingToDeleting, or any replicationConfiguration. Non-gated updates do not need it. | |
| bucketId | Yes | The exact bucket ID to update, not the bucket name. | |
| corsRules | No | CORS rules: <=100. allowedOrigins/allowedOperations require 1-100 non-empty strings; allowedHeaders/exposeHeaders allow <=100. Strings <=999 chars. Per-rule UTF-8 total <1,000. Names unique. On update, provided rules replace the existing set; omit to leave unchanged. | |
| bucketInfo | No | Custom metadata: <=10 pairs. Keys: 1-50 UTF-8 bytes, chars A-Z a-z 0-9 . _ ` ~ ! # $ % ^ & * ' | + -, no b2- prefix. Values total <=10,000 UTF-8 bytes. Omit to leave current metadata unchanged. | |
| bucketType | No | Optional visibility change. allPublic makes objects world-readable by URL and is governed by the configured destructive policy; omit to leave unchanged. | |
| ifRevisionIs | No | Conditional update — only update if the bucket revision matches this value. | |
| lifecycleRules | No | When provided, replaces the bucket's B2 lifecycle rule set; omit to leave unchanged. Rules that delete hidden versions are destructive in effect and are governed by the configured destructive policy. | |
| fileLockEnabled | No | Enable Object Lock on the bucket. Unlike S3's PutObjectLockConfiguration (which only enables lock at bucket creation), the B2 native API allows enabling Object Lock on an existing bucket here. Requires the writeBucketRetentions capability. | |
| defaultRetention | No | Default Object Lock retention for newly uploaded objects. Requires Object Lock enabled on the bucket. Send { mode: null, period: null } to clear. | |
| replicationConfiguration | No | Optional replication configuration. Omit to leave unchanged; any provided value changes persistent copy behavior and is confirmation-gated. | |
| defaultServerSideEncryption | No | Default server-side encryption for new files in this bucket. Omit on update to leave unchanged. |