Skip to main content
Glama
backblaze-labs

Backblaze B2 MCP Server

Official

b2_update_bucket

DestructiveIdempotent

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
confirmNoFallback 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.
bucketIdYesThe exact bucket ID to update, not the bucket name.
corsRulesNoCORS 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.
bucketInfoNoCustom 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.
bucketTypeNoOptional visibility change. allPublic makes objects world-readable by URL and is governed by the configured destructive policy; omit to leave unchanged.
ifRevisionIsNoConditional update — only update if the bucket revision matches this value.
lifecycleRulesNoWhen 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.
fileLockEnabledNoEnable 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.
defaultRetentionNoDefault Object Lock retention for newly uploaded objects. Requires Object Lock enabled on the bucket. Send { mode: null, period: null } to clear.
replicationConfigurationNoOptional replication configuration. Omit to leave unchanged; any provided value changes persistent copy behavior and is confirmation-gated.
defaultServerSideEncryptionNoDefault server-side encryption for new files in this bucket. Omit on update to leave unchanged.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed24 schema fields changed
    • changedInput schema / properties / bucketId / description
      Previous value: -"The ID of the bucket to update."New value: +"The exact bucket ID to update, not the bucket name."
    • changedInput schema / properties / bucketInfo / description
      Previous value: -"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."New value: +"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."
    • addedInput schema / properties / bucketType / description
      Added value: +"Optional visibility change. allPublic makes objects world-readable by URL and is governed by the configured destructive policy; omit to leave unchanged."
    • changedInput schema / properties / confirm / description
      Previous value: -"Confirm a destructive change (making the bucket public, weakening Object Lock/lifecycle, or changing replication). Required when the server destructive policy is 'confirm' (the default); non-destructive updates do not need it."New value: +"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."
    • changedInput schema / properties / corsRules / description
      Previous value: -"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."New value: +"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."
    • addedInput schema / properties / defaultServerSideEncryption / description
      Added value: +"Default server-side encryption for new files in this bucket. Omit on update to leave unchanged."
    • addedInput schema / properties / defaultServerSideEncryption / properties / algorithm / description
      Added value: +"Encryption algorithm. B2 supports AES256 for SSE-B2."
    • addedInput schema / properties / defaultServerSideEncryption / properties / mode / description
      Added value: +"Use SSE-B2 to make AES256 the bucket default; use none to clear the bucket default."
    • addedInput schema / properties / lifecycleRules / description
      Added value: +"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."
    • addedInput schema / properties / lifecycleRules / items / properties / daysFromHidingToDeleting / description
      Added value: +"Optional days after a file is hidden before B2 permanently deletes it; minimum 1."
    • addedInput schema / properties / lifecycleRules / items / properties / daysFromStartingToCancelingUnfinishedLargeFiles / description
      Added value: +"Optional days before B2 cancels unfinished large-file uploads; minimum 1."
    • addedInput schema / properties / lifecycleRules / items / properties / daysFromUploadingToHiding / description
      Added value: +"Optional days after upload before B2 hides the current file version; minimum 1."
    • addedInput schema / properties / lifecycleRules / items / properties / fileNamePrefix / description
      Added value: +"Object-key prefix this rule matches; use an empty string to match the bucket."
    • addedInput schema / properties / replicationConfiguration / description
      Added value: +"Optional replication configuration. Omit to leave unchanged; any provided value changes persistent copy behavior and is confirmation-gated."
    • addedInput schema / properties / replicationConfiguration / properties / asReplicationDestination / description
      Added value: +"Destination replication settings for buckets receiving replicated data."
    • addedInput schema / properties / replicationConfiguration / properties / asReplicationDestination / properties / sourceToDestinationKeyMapping / description
      Added value: +"Mapping from source key IDs to destination key IDs."
    • addedInput schema / properties / replicationConfiguration / properties / asReplicationSource / description
      Added value: +"Source replication settings. Provided rules replace the source config."
    • addedInput schema / properties / replicationConfiguration / properties / asReplicationSource / properties / replicationRules / items / properties / destinationBucketId / description
      Added value: +"Destination bucket ID that receives replicated objects."
    • addedInput schema / properties / replicationConfiguration / properties / asReplicationSource / properties / replicationRules / items / properties / fileNamePrefix / description
      Added value: +"Optional object-key prefix to replicate; omit for all objects."
    • addedInput schema / properties / replicationConfiguration / properties / asReplicationSource / properties / replicationRules / items / properties / includeExistingFiles / description
      Added value: +"If true, B2 also queues existing matching files for replication."
    • addedInput schema / properties / replicationConfiguration / properties / asReplicationSource / properties / replicationRules / items / properties / isEnabled / description
      Added value: +"Whether this replication rule is active."
    • addedInput schema / properties / replicationConfiguration / properties / asReplicationSource / properties / replicationRules / items / properties / priority / description
      Added value: +"Rule priority used by B2 when rules overlap."
    • addedInput schema / properties / replicationConfiguration / properties / asReplicationSource / properties / replicationRules / items / properties / replicationRuleName / description
      Added value: +"Unique name for this rule."
    • addedInput schema / properties / replicationConfiguration / properties / asReplicationSource / properties / sourceApplicationKeyId / description
      Added value: +"Application key ID B2 uses as the replication source credential."
  2. First observedv0.2.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already carry readOnlyHint=false and destructiveHint=true; the description adds value beyond them by naming the required capability (writeBuckets), enumerating the confirmation-gated cases (bucketType allPublic, fileLockEnabled false, defaultRetention.mode null, lifecycleRules with daysFromHidingToDeleting, replicationConfiguration updates), and flagging that delete-rule lifecycle updates are destructive in effect. No contradiction with the annotations.

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?

A single dense paragraph, front-loaded with purpose, followed by capability, precondition, alternative routing, and gated cases. Every clause carries distinct information, and nothing in the description repeats what the schema already documents.

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

Completeness4/5

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

For an 11-parameter, confirmation-gated, destructive mutation tool with no output schema, the description covers capability requirements, precondition workflow, gated cases, and sibling differentiation — most of what an agent needs before invoking. The remaining gap is the response shape on success (e.g., updated bucket object and changed revision value), which would strengthen ifRevisionIs retry logic.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline of 3 applies and the schema does the heavy lifting. The description adds only light operational context for two parameters (bucketId must be the exact ID, ifRevisionIs enables safer retries), which is useful but not new semantic meaning beyond the schema.

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?

The description opens with a specific verb and resource — 'Update persistent settings on an existing B2 bucket' — and enumerates the scope (visibility, metadata, CORS, lifecycle, default encryption, replication, Object Lock, default retention). This cleanly distinguishes it from siblings like b2_create_bucket, b2_delete_bucket, and s3_put_bucket_lifecycle without requiring schema inspection.

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

Usage Guidelines5/5

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

Provides an explicit precondition ('Use b2_list_buckets first to inspect the current bucketId/revision'), a safer retry pattern via ifRevisionIs, and a named alternative with a selection condition ('use s3_put_bucket_lifecycle only when you specifically need the S3 lifecycle API shape'). When-to-use, when-not-to-use, and alternatives are all spelled out.

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