{
  "slug": "wrangler-ai-search-create-accepts-custom-metadata-schemas-7dc7270e5304",
  "title": "wrangler ai-search create accepts custom metadata schemas",
  "tools": [
    "wrangler"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-05-05T17:42:09.000Z",
  "announced_at": "2026-05-05T17:42:09.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When creating an AI Search instance with custom metadata fields to index, run `wrangler ai-search create` with repeatable `--custom-metadata` flags or a JSON schema file via `--custom-metadata-schema`.",
    "examples": [
      "wrangler ai-search create <NAME> --type r2 --source <BUCKET> --custom-metadata <FIELD>:<TYPE> --custom-metadata <FIELD>:<TYPE>",
      "wrangler ai-search create <NAME> --type r2 --source <BUCKET> --custom-metadata-schema <SCHEMA.json>"
    ],
    "gotchas": [
      "Version: 4.88.0",
      "<NAME> (required): Unique AI Search instance name within its namespace.",
      "--type: Source type for the instance; use `r2` for an R2 bucket.",
      "--source: Data source identifier, such as an R2 bucket name.",
      "--custom-metadata: Repeatable field in `field_name:data_type` form; types: `text`, `number`, `boolean`, `datetime`. Mutually exclusive with `--custom-metadata-schema`.",
      "--custom-metadata-schema: Path to a JSON file containing an array of `{ \"field_name\", \"data_type\" }` objects. Mutually exclusive with `--custom-metadata`.",
      "Prerequisite: Install Wrangler before using its CLI; Cloudflare's AI Search CLI guide gives `npm install wrangler` as an installation command.",
      "Supported data types are `text`, `number`, `boolean`, and `datetime`.",
      "The JSON file must contain an array of `{ field_name, data_type }` objects."
    ]
  },
  "why_it_matters": "Create an AI Search instance with metadata fields that it should index.",
  "sources": [
    "https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.88.0",
    "https://developers.cloudflare.com/ai-search/wrangler-commands/",
    "https://developers.cloudflare.com/ai-search/get-started/wrangler/"
  ],
  "rank": 0.94029,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "backfill-20261007",
    "verdict_id": "backfill-20261007:backfill-20261007-be355821c3d2bd6f-1:gate",
    "evidence_hash": "59e849e81346f7a620b8fe7dbdfcedb8b50974ea9918325092009817e146bf49"
  },
  "review": {
    "draft_hash": "fe568eca0853e637f0f76c46eb6ea9ce2d8be7e2b3554c1a16ddf48b2febc5f3",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "backfill-20261007:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.94 >= 0.9; 2 needed) and Jev gave 0.82 (>= 0.6 needed)."
  }
}
