The 10 core object tools operate on the R2 bucket bound to the Worker via theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/xxyoudeadpunkxx/cloudflare-r2-remote-mcp-worker/llms.txt
Use this file to discover all available pages before exploring further.
R2_BUCKET binding. No additional credentials are required beyond the binding itself. When R2_ROOT_PREFIX is set, all keys accepted by and returned from these tools are relative to that prefix — the Worker handles prefix resolution transparently.
r2_object_list
Lists objects and delimited prefixes under the configured R2 root prefix. Supports prefix filtering, pagination via cursor, and delimiter-based hierarchy simulation. ParametersReturn only objects whose keys begin with this string. Optional.
Maximum number of objects to return. Must be between 1 and
MAX_LIST_LIMIT (default 100). Optional.Pagination cursor returned from a previous truncated response. Optional.
Single character used to group keys into virtual directories. Typically
/. Optional.{ objects: [...], delimitedPrefixes: [...], truncated: boolean, cursor?: string, rootPrefix: string }
Example
r2_object_head
Returns metadata for one object without fetching its body. Use this to check whether an object exists or to read its content type, size, ETag, and custom metadata before deciding whether to download it. ParametersThe object key, relative to
R2_ROOT_PREFIX when set.{ key, size, contentType, etag, lastModified, customMetadata }
Example
r2_object_get
Reads and returns the content of a text-like R2 object as a UTF-8 string. The tool checks the content type before fetching and rejects binary content types. Object size must not exceedMAX_INLINE_TEXT_BYTES (default 262,144 bytes).
Text-like content types include text/*, application/json, application/ld+json, application/xml, application/yaml, application/x-yaml, application/javascript, application/x-javascript, and application/typescript.
Parameters
The object key, relative to
R2_ROOT_PREFIX when set.{ key, content, contentType, etag, size, lastModified }
For binary content types or objects exceeding
MAX_INLINE_TEXT_BYTES, use r2_download_base64 or generate a presigned URL with r2_presign_get.Example
r2_object_put
Writes UTF-8 text to an R2 object, creating or overwriting it. The encoded byte length oftext must not exceed MAX_TRANSFER_BYTES (default 1,048,576 bytes). Providing expectedEtag enables a conditional write — the operation returns a 409 error if the current ETag does not match.
Parameters
The destination object key, relative to
R2_ROOT_PREFIX when set.The UTF-8 text body to write.
MIME type to store with the object. Optional.
Key-value string pairs stored as object metadata. Optional.
If provided, the write only proceeds when the existing object ETag matches this value. Returns 409 on mismatch. Optional.
ObjectMetadata — { key, size, contentType, etag, lastModified, customMetadata }
Example
r2_object_put_if_absent
Creates a UTF-8 text object only when the key does not already exist. If the object is present, the tool returns a 409 conflict error without modifying the existing content. ParametersThe destination object key, relative to
R2_ROOT_PREFIX when set.The UTF-8 text body to write.
MIME type to store with the object. Optional.
Key-value string pairs stored as object metadata. Optional.
ObjectMetadata — { key, size, contentType, etag, lastModified, customMetadata }
Example
r2_object_delete
Deletes one object from the bound R2 bucket. Theconfirm: true field is required in the input to prevent accidental deletion.
Parameters
The object key to delete, relative to
R2_ROOT_PREFIX when set.Must be the literal value
true. Required guard against accidental deletion.{ deleted: true, key: string }
Example
r2_object_delete_many
Deletes multiple objects from the bound R2 bucket in a single call. Accepts between 1 andMAX_LIST_LIMIT keys. When dryRun: true is provided, the tool returns the planned operation without modifying R2.
Parameters
Array of object keys to delete (1 to
MAX_LIST_LIMIT items).Must be the literal value
true. Required guard against accidental deletion.When
true, returns the planned operation without deleting anything. Optional.{ deletedKeys: string[] } or a dry-run preview object.
Example
Dry run
r2_object_copy
Copies an object to a new key within the bound bucket. The operation is implemented as a read followed by a write and is therefore not atomic. By default the tool rejects the operation if the destination key already exists. ParametersThe key of the object to copy, relative to
R2_ROOT_PREFIX when set.The key to copy the object to, relative to
R2_ROOT_PREFIX when set.When
true, overwrites the destination if it exists. Defaults to false. Optional.Conditional guard: copy only proceeds when the source ETag matches. Optional.
Conditional guard: copy only proceeds when the destination ETag matches. Optional.
{ source: ObjectMetadata, destination: ObjectMetadata }
Example
r2_object_move
Moves an object to a new key by performing a copy followed by a delete of the source. Requiresconfirm: true. When dryRun: true is provided, the planned steps are returned without any mutation.
Parameters
The key of the object to move.
The key to move the object to.
Must be the literal value
true. Required guard.When
true, overwrites the destination if it exists. Optional.When
true, returns the planned steps without mutating R2. Optional.Conditional guard on the source object. Optional.
Conditional guard on the destination object. Optional.
{ sourceKey, deletedSourceKey, destination: ObjectMetadata }
Example
r2_object_rename
Renames an object by moving it to a new basename within its current prefix or an explicitly specified target prefix. ThenewName field must be a plain filename with no path separators. Like move, this is copy then delete and is not atomic.
Parameters
The current full object key.
The new basename for the object. Must not be empty and must not contain path separators.
Must be the literal value
true. Required guard.Explicit prefix to place the renamed object under. If omitted, the object keeps its current prefix. Optional.
When
true, overwrites the destination if it exists. Optional.When
true, returns the planned operation without mutating R2. Optional.Conditional guard on the source object. Optional.
Conditional guard on the destination object. Optional.
{ sourceKey, deletedSourceKey, destinationKey, destination: ObjectMetadata }
Example
Destructive Guards
Destructive tools enforce confirmation at the schema level. Omittingconfirm: true causes the call to fail validation before any R2 operation is attempted.
| Tool | Required | Optional |
|---|---|---|
r2_object_delete | confirm: true | — |
r2_object_delete_many | confirm: true | dryRun: true |
r2_object_move | confirm: true | dryRun: true |
r2_object_rename | confirm: true | dryRun: true |
dryRun: true is provided alongside confirm: true, the tool returns a structured preview of the planned operation — including the keys that would be affected — without making any changes to R2.