Skip to main content
Glama
backblaze-labs

Backblaze B2 MCP Server

Official

b2_create_bucket

Create a new B2 bucket with optional CORS, lifecycle, encryption, and Object Lock settings. Use for initial provisioning; duplicate names are rejected.

Instructions

Create a persistent B2 bucket with optional metadata, CORS, lifecycle, default encryption, and Object Lock enablement. Use for initial provisioning with a key that has writeBuckets; use b2_update_bucket for later settings changes and s3_head_bucket to check S3 reachability. Bucket names are globally unique, case-insensitive, 6-63 characters, letters/digits/hyphens/periods, and cannot start with 'b2-', begin/end with a period, contain '..', or look like an IPv4 address. Because names are unique across all of B2, requesting a name already in use (by this or any other account) fails with a duplicate-name error instead of returning the existing bucket; reuse the existing bucket only if it belongs to your own account, otherwise choose a different globally unique name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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. Omit to create the bucket without CORS rules.
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 create the bucket without custom metadata.
bucketNameYesGlobally unique bucket name: 6-63 characters, letters/digits/hyphens/periods, case-insensitive, no b2- prefix, no leading/trailing period, no '..', and not an IPv4 address.
bucketTypeYesVisibility for file downloads: allPrivate requires authorization; allPublic makes objects world-readable by URL.
lifecycleRulesNoOptional B2 lifecycle rules applied after creation. Use for automatic hiding, deletion of hidden versions, or cancellation of unfinished large-file uploads; use s3_put_bucket_lifecycle only when you need the S3 lifecycle API shape.
fileLockEnabledNoEnable Object Lock (file lock) on the bucket at creation. (Object Lock can also be enabled later on an existing bucket via b2_update_bucket.) Must be true before any retention or legal hold can be applied to files in this bucket.
defaultServerSideEncryptionNoOptional default server-side encryption for new files in this bucket. Omit to create the bucket without a bucket default encryption setting.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changed
    • 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 create the bucket without custom metadata."
    • changedInput schema / properties / bucketName / description
      Previous value: -"The name for the new bucket. Must be globally unique."New value: +"Globally unique bucket name: 6-63 characters, letters/digits/hyphens/periods, case-insensitive, no b2- prefix, no leading/trailing period, no '..', and not an IPv4 address."
    • changedInput schema / properties / bucketType / description
      Previous value: -"allPublic allows unauthenticated downloads; allPrivate requires authorization."New value: +"Visibility for file downloads: allPrivate requires authorization; allPublic makes objects world-readable by URL."
    • 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. Omit to create the bucket without CORS rules."
    • changedInput schema / properties / defaultServerSideEncryption / description
      Previous value: -"Default server-side encryption for new files in this bucket."New value: +"Optional default server-side encryption for new files in this bucket. Omit to create the bucket without a bucket default encryption setting."
    • 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 for no bucket default encryption."
    • changedInput schema / properties / lifecycleRules / description
      Previous value: -"Lifecycle rules for automatic file management."New value: +"Optional B2 lifecycle rules applied after creation. Use for automatic hiding, deletion of hidden versions, or cancellation of unfinished large-file uploads; use s3_put_bucket_lifecycle only when you need the S3 lifecycle API shape."
    • 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."
  2. First observedv0.2.0

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations, the description adds important behavioral context: bucket names are globally unique, duplicate-name requests fail with an error instead of returning the existing bucket, and the existing bucket may only be reused if it belongs to the caller's own account. It also discloses the required writeBuckets permission and the persistent nature of the created bucket. No contradiction with annotations.

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?

The description is front-loaded with the core purpose and then routes to alternatives. It is somewhat longer than necessary because the bucket-name character rules partly repeat the schema's bucketName description, but the duplicate-name behavior and reuse guidance justify the third sentence. Overall it is economical and well-structured.

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 a complex 7-parameter creation tool with nested objects and no output schema, the description covers the key operational concerns: when to use it, required permission, alternatives, naming constraints, and duplicate-name behavior. It does not describe the success response format, but the rich schema compensates for most gaps.

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 description coverage is 100%, so the schema already documents parameters in detail. The description adds value by explaining global uniqueness, duplicate-name failure semantics, and permission requirements beyond the schema. It does not deeply explain every optional parameter, but the schema covers those, so this is more than the baseline.

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 starts with a specific verb and resource: 'Create a persistent B2 bucket', and enumerates the optional capabilities (metadata, CORS, lifecycle, encryption, Object Lock). It also distinguishes itself from siblings by naming b2_update_bucket for later changes and s3_head_bucket for S3 reachability, so an agent can tell them apart.

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?

The description explicitly states when to use this tool: 'initial provisioning with a key that has writeBuckets'. It also names the alternatives and their conditions: b2_update_bucket for later settings changes and s3_head_bucket for S3 reachability. It even gives conditional guidance for duplicate-name scenarios, which is actionable and complete.

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