Cloudflare R2 Storage icon

Cloudflare R2 Storage

Interact with Cloudflare R2 object storage. Upload, download, manage files and buckets. Supports batch operations, multipart uploads, and can be used as a tool by AI Agents.

Object → Search

AI-generated

Summary

Searches for objects in an R2 bucket by filename pattern, extension, or containment.

Inputs

  • bucketName (required) — Name of the R2 bucket to search within.
  • searchOptions — Options controlling the search, including filename contains, extension, pattern, prefix, and result limits.

Output shape

An object containing an array of matching objects, search criteria, pagination flags, and result counts.

The returned object includes objects (matched files), search_criteria, total_searched, and results_count. Pagination fields like truncated may be present.

Examples

Example 1: Find all PDF invoices in a bucket

bucketName: invoices, searchOptions: {"fileExtension": "pdf", "contains": "invoice"}

Example 2: List up to 200 images matching a wildcard pattern

bucketName: images, searchOptions: {"pattern": "*.jpg", "maxResults": 200}

Discussion