{
  "slug": "wrangler-web-search-binding-and-ad-hoc-cli-search-e0cae688c0b4",
  "title": "wrangler web_search binding and ad hoc CLI search",
  "tools": [
    "wrangler"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-06-01T17:11:05.000Z",
  "announced_at": "2026-06-01T17:11:05.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When adding web discovery to a Worker, declare the `web_search` binding and call its `search()` method; use global `fetch()` with a result URL to read content. For a one-off query, run the Wrangler `websearch search` command with optional `--limit` or `--json`.",
    "examples": [
      "{\"web_search\": {\"binding\": \"WEBSEARCH\"}}",
      "npx wrangler websearch search \"cloudflare workers\" --limit 5",
      "npx wrangler websearch search \"cloudflare workers\" --json"
    ],
    "gotchas": [
      "Version: 4.96.0",
      "web_search.binding (required): Binding variable name available to Worker code; the example uses `WEBSEARCH`.",
      "search() query (required): Query searched by the binding; returns URLs and catalog metadata.",
      "--limit <number>: Maximum results; defaults to 10 and is capped at 20.",
      "--json: Print the raw response instead of a pretty table.",
      "Prerequisite: Wrangler login adds the `websearch.run` OAuth scope.",
      "Prerequisite: The binding connects remotely during local development through Miniflare’s remote-bindings transport.",
      "The shared corpus is singular; no namespace, instance, or other field is specified, only the variable name.",
      "The binding is always remote in local development: Miniflare proxies to the production Web Search service via remote-bindings transport.",
      "Web Search is discovery-only; invoke global `fetch()` against a result’s `url` to read its content.",
      "`--limit` defaults to 10 and is capped at 20.",
      "Docs conflict: The current Cloudflare Web Search docs describe calling `env.AI.websearch()` with an AI binding; that API differs from the Wrangler 4.96.0 `web_search` binding described in the release note. https://developers.cloudflare.com/web-search/how-to-use/"
    ]
  },
  "why_it_matters": "Add web discovery to a Worker or run a one-off search while developing it.",
  "sources": [
    "https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.96.0"
  ],
  "rank": 0.9805,
  "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-4fd91da653026af1-0:gate",
    "evidence_hash": "bf8fd56d4a6207c451cc459021157a5049f98720ca8b0c09c0e13b124154296b"
  },
  "review": {
    "draft_hash": "011d60917c7a214d29534294739aa3b59af072423e45e95504a2cffdb27e0a04",
    "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.98 >= 0.9; 2 needed) and Jev gave 0.84 (>= 0.6 needed)."
  }
}
