{
  "openapi": "3.1.0",
  "jsonSchemaDialect": "https://spec.openapis.org/oas/3.1/dialect/base",
  "info": {
    "title": "EdgeFetch Hub API",
    "summary": "Self-hosted web scraping, search, browser automation, and MCP coordinator for AI agents.",
    "version": "2.8.44",
    "description": "EdgeFetch Hub coordinates polite outbound-only Go worker nodes (HTTP/2, Headless Chromium, Poppler PDF/OCR, and 49+ keyless site adapters) with strict RFC 9309 robots.txt and Content-Signal compliance, D1 FTS5 hybrid search, R2 content-addressed artifacts, self-hosted OAuth 2.1 PKCE, and Streamable HTTP Model Context Protocol (`POST /mcp`).",
    "contact": {
      "name": "EdgeFetch",
      "url": "https://edgefetch.dev"
    },
    "license": {
      "name": "FSL-1.1-MIT (Hub) / MIT (Worker, SDKs & Adapters)",
      "url": "https://github.com/bartrumb/edgefetch/blob/main/README.md#license--trademarks"
    }
  },
  "servers": [
    {
      "url": "https://edgefetch.dev",
      "description": "EdgeFetch Canonical Specification Origin (replace with your self-hosted Hub URL)"
    }
  ],
  "tags": [
    {
      "name": "Discovery",
      "description": "Health checks, OpenAPI 3.1.0 schema, RFC 9421 Web Bot Auth directory, and OAuth 2.1 metadata."
    },
    {
      "name": "System",
      "description": "Hub capabilities, keyless site adapters, per-host health telemetry, stored artifacts, and worker fleet."
    },
    {
      "name": "Scraping & Extraction",
      "description": "Polite URL-to-Markdown scraping, multi-URL batch scraping, BM25 passage extraction, and tab clipping."
    },
    {
      "name": "Browser Automation",
      "description": "Sandboxed Headless Chromium interaction with dial-time SSRF isolation and session persistence."
    },
    {
      "name": "Crawl & Map",
      "description": "Fast sitemap/llms.txt URL discovery and asynchronous breadth-first site crawling."
    },
    {
      "name": "Search & Collections",
      "description": "Edge-first web search waterfall (Serper/Tavily/Brave/SearXNG) and private D1 FTS5 collection search."
    },
    {
      "name": "Vertical Intelligence",
      "description": "Normalized multi-ATS job search/verification and polite full-store Shopify/WooCommerce catalog diffing."
    },
    {
      "name": "Autonomous Agent",
      "description": "Multi-step web research and structured JSON extraction powered by BYO-LLM or local Ollama."
    },
    {
      "name": "Coordinator & MCP",
      "description": "Low-level multi-URL coordinator dispatch (`POST /fetch`) and Streamable HTTP MCP (`POST /mcp`)."
    },
    {
      "name": "Compatibility",
      "description": "Drop-in Firecrawl v2 (`/v2/*`) compatibility endpoints for unmodified third-party SDKs."
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "operationId": "getHealth",
        "summary": "Check Hub liveness",
        "description": "Returns HTTP 200 `{ \"ok\": true }` without authentication for uptime monitors and container health checks.",
        "security": [],
        "responses": {
          "200": {
            "description": "Hub is healthy.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "operationId": "getOpenApiSpec",
        "summary": "Fetch OpenAPI 3.1.0 specification",
        "description": "Returns this OpenAPI 3.1.0 document with permissive CORS (`Access-Control-Allow-Origin: *`) for 1-click import into ChatGPT Actions, OpenWebUI, Dify, n8n, Postman, and Scalar.",
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1.0 JSON document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              },
              "application/openapi+json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/edgefetch-bot.json": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "operationId": "getBotManifest",
        "summary": "Get machine-readable bot transparency manifest",
        "description": "Declares EdgeFetch User-Agent, strict RFC 9309 robots.txt and Content-Signal (`ai-input`) policies, anti-bot challenge halt guarantee, and RFC 9421 Web Bot Auth key directory link.",
        "security": [],
        "responses": {
          "200": {
            "description": "Bot transparency manifest.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BotManifestResponse"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/http-message-signatures-directory": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "operationId": "getBotSignaturesDirectory",
        "summary": "Get RFC 9421 Web Bot Auth Ed25519 JWKS directory",
        "description": "Serves public Ed25519 signing keys (`application/http-message-signatures-directory+json`) with cryptographic self-signatures for origin verification.",
        "security": [],
        "responses": {
          "200": {
            "description": "RFC 9421 HTTP Message Signatures JWKS directory.",
            "content": {
              "application/http-message-signatures-directory+json": {
                "schema": {
                  "$ref": "#/components/schemas/BotKeyDirectoryResponse"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/oauth-protected-resource": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "operationId": "getOAuthProtectedResource",
        "summary": "Get RFC 9728 OAuth 2.1 Protected Resource metadata",
        "description": "Advertises protected MCP resource URI, authorization server issuer, and supported scopes (`crawl:read`, `crawl:fetch`, `mcp:call`).",
        "security": [],
        "responses": {
          "200": {
            "description": "OAuth 2.1 Protected Resource metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthProtectedResourceMetadata"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/oauth-authorization-server": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "operationId": "getOAuthAuthorizationServer",
        "summary": "Get RFC 8414 OAuth 2.1 Authorization Server metadata",
        "description": "Advertises `/oauth/authorize`, `/oauth/token`, `/oauth/register` (RFC 7591 Dynamic Client Registration), `/oauth/revoke`, and mandatory `S256` PKCE support (with optional multi-user Sign in with GitHub).",
        "security": [],
        "responses": {
          "200": {
            "description": "OAuth 2.1 Authorization Server metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthAuthorizationServerMetadata"
                }
              }
            }
          }
        }
      }
    },
    "/admin/auth/github": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "operationId": "startGitHubOAuthLogin",
        "summary": "Start Sign in with GitHub OAuth 2.0 + PKCE S256 login",
        "description": "Initiates an `oauth4webapi` OAuth 2.0 + PKCE (`S256`) + sealed `state` cookie redirect to GitHub (`https://github.com/login/oauth/authorize`) for `/admin` and `/oauth/authorize` multi-user authentication.",
        "security": [],
        "parameters": [
          {
            "name": "return_to",
            "in": "query",
            "required": false,
            "description": "Optional relative Hub path (`/admin` or `/oauth/authorize?...`) to return to after sign-in.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to GitHub OAuth 2.0 authorization endpoint."
          },
          "503": {
            "description": "GitHub OAuth (`GITHUB_CLIENT_ID` / `GITHUB_CLIENT_SECRET`) is not configured on this Hub.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/admin/auth/github/callback": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "operationId": "completeGitHubOAuthCallback",
        "summary": "Complete Sign in with GitHub OAuth 2.0 callback",
        "description": "Validates OAuth `state` + PKCE `S256`, verifies `SIGNUP_MODE` (`invite_only` default) + `GITHUB_ALLOWED_USERS` (`login` or `@org`) + `GITHUB_OWNER_LOGIN`, and issues an `HS256` `jose` session JWT cookie.",
        "security": [],
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Authenticated session cookie issued; redirecting back to Hub UI."
          },
          "400": {
            "description": "Missing/invalid state cookie or OAuth callback error."
          },
          "403": {
            "description": "GitHub account is not authorized under `SIGNUP_MODE` / `GITHUB_ALLOWED_USERS`."
          }
        }
      }
    },
    "/v1/capabilities": {
      "get": {
        "tags": [
          "System"
        ],
        "operationId": "getCapabilities",
        "summary": "Inspect Hub storage, search, OCR, and LLM bindings",
        "description": "Reports configured Hub bindings (`ARTIFACTS` R2, `META` D1, `SEARCH` D1 FTS5, `INGEST` Workflow, SERP providers, and BYO-LLM readiness).",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Hub capability report.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CapabilitiesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/extractors": {
      "get": {
        "tags": [
          "System"
        ],
        "operationId": "listExtractors",
        "summary": "List built-in keyless site and API adapters",
        "description": "Lists EdgeFetch’s 49+ built-in keyless site adapters (SEC EDGAR, Ashby/Greenhouse/Lever/Workday ATS, arXiv, OpenAlex, PubChem, NVD CVEs, npm, PyPI, Crates, Shopify, etc.).",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Optional adapter category filter.",
            "schema": {
              "type": "string",
              "enum": [
                "jobs",
                "finance",
                "public-records",
                "research-health",
                "developer",
                "genai",
                "commerce-social"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Registered keyless site adapters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtractorsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/hosts": {
      "get": {
        "tags": [
          "System"
        ],
        "operationId": "listHostHealth",
        "summary": "List per-host politeness, EWMA TTFB, and 429 health metrics",
        "description": "Returns per-origin EWMA latency, recommended polite pause intervals, HTTP 429 streaks, and detected WAF vendors.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum host health records to return (1..500, default 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Per-host telemetry records.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostsHealthResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/search/spend": {
      "get": {
        "tags": [
          "System"
        ],
        "operationId": "getSearchSpend",
        "summary": "Search-provider spend per provider per day (owner only)",
        "description": "Sums the list-price cost of every search-provider call recorded in `META` D1 `search_spend` (from each provider manifest `cost.usdPerRequest`), by UTC day and provider. Estimates, not bills.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Lookback window in days (`1..400`, default `30`).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 400,
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Spend rows `{day, provider, calls, costUsd}`, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/hosts/gaps": {
      "get": {
        "tags": [
          "System"
        ],
        "operationId": "listHostAdapterGaps",
        "summary": "Rank origin hosts by headless browser fallback time and non-OK fetch rate",
        "description": "Queries `META` D1 `fetches` telemetry (`auto-render-1` / `ext-auto-*` browser renders and non-OK outcomes) over the requested window and cross-references each host against `listRegisteredAdapters()` to prioritize declarative YAML adapter authoring.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Lookback window in days (`1..90`, default `7`).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90,
              "default": 7
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum ranked hosts to return (`1..100`, default `25`).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "unadapted",
            "in": "query",
            "required": false,
            "description": "When `true`, omit hosts already covered by a registered adapter.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked host gap telemetry and scaffold commands.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/artifacts/{blobSha256}": {
      "get": {
        "tags": [
          "System"
        ],
        "operationId": "getArtifact",
        "summary": "Read or page a stored artifact from R2",
        "description": "Streams or pages a content-addressed R2 artifact (`64`-char hex `blobSha256` or `md:<sha256>` derived Markdown) using character `offset` and `limit`.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "blobSha256",
            "in": "path",
            "required": true,
            "description": "64-character lowercase hex SHA-256 (`blobSha256`) or `md:<sha256>` derived Markdown ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "raw",
                "markdown"
              ]
            }
          },
          {
            "name": "retention",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "transient",
                "stored"
              ]
            }
          },
          {
            "name": "visibility",
            "in": "query",
            "required": false,
            "description": "Set to `private` to read strictly from the authenticated user’s `private/<userId>/...` R2 namespace.",
            "schema": {
              "type": "string",
              "enum": [
                "public",
                "private"
              ]
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1048576,
              "default": 65536
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Artifact slice or raw stream.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtifactPageResponse"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Artifact not found or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/scrape": {
      "post": {
        "tags": [
          "Scraping & Extraction"
        ],
        "operationId": "scrapeUrl",
        "summary": "Scrape a public HTTPS URL to clean Markdown, JSON, or metadata",
        "description": "Scrapes one public `https://` URL politely through connected worker nodes, automatically upgrading to keyless API adapters, companion `/llms.txt` `.md` docs, Poppler/Tesseract PDF extraction, `.ipynb` / OpenAPI converters, or Headless Chromium rendering when needed.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScrapeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Scrape result with Markdown, metadata, links, and provenance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScrapeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/batch/scrape": {
      "post": {
        "tags": [
          "Scraping & Extraction"
        ],
        "operationId": "createBatchScrape",
        "summary": "Start or execute a multi-URL batch scrape job",
        "description": "Scrapes 1..100 public `https://` URLs with per-host pacing, returning either an async batch ID or inline `data` when `sync: true`.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchScrapeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Completed synchronous batch scrape.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchScrapeStatusResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted asynchronous batch scrape job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchScrapeStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/batch/scrape/{batchId}": {
      "get": {
        "tags": [
          "Scraping & Extraction"
        ],
        "operationId": "getBatchScrape",
        "summary": "Get batch scrape job status and results",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "batchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Batch scrape job status and collected documents.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchScrapeStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Batch job not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Scraping & Extraction"
        ],
        "operationId": "cancelBatchScrape",
        "summary": "Cancel a running batch scrape job",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "parameters": [
          {
            "name": "batchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Batch scrape cancelled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Batch job not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/extract": {
      "post": {
        "tags": [
          "Scraping & Extraction"
        ],
        "operationId": "extractUrls",
        "summary": "Extract BM25-ranked passages across 1..20 URLs",
        "description": "Fetches up to 20 public `https://` URLs politely, converts each to verified Markdown, and returns the top BM25 query-ranked chunks per source.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtractRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ranked passages and extraction metadata per URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtractResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/interact": {
      "post": {
        "tags": [
          "Browser Automation"
        ],
        "operationId": "interactBrowser",
        "summary": "Drive a sandboxed Headless Chromium session",
        "description": "Executes browser actions (`click`, `fill`, `type`, `press`, `wait`, `scroll`, `select`, `navigate`) inside an incognito Chromium context on a `browser-v1` worker node with dial-time SSRF isolation and automatic halt on anti-bot challenges.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InteractRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Browser session output (Markdown, HTML, screenshot, or transcript) and optional `sessionId`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InteractResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/map": {
      "post": {
        "tags": [
          "Crawl & Map"
        ],
        "operationId": "mapSiteUrls",
        "summary": "Discover URLs on a domain via sitemaps, /llms.txt, and links",
        "description": "Rapidly maps a site’s URLs using `robots.txt` `Sitemap:` directives, `sitemap.xml` / `.xml.gz`, `/llms.txt`, and homepage links with optional keyword ranking.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MapRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Discovered URL list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MapResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crawl/params-preview": {
      "post": {
        "tags": [
          "Crawl & Map"
        ],
        "operationId": "previewCrawlParams",
        "summary": "Synthesize crawl path filters and depth from natural language",
        "description": "Deterministically converts a natural-language crawl instruction (`prompt`) and root `url` into `includePaths`, `excludePaths`, `maxDepth`, and `limit`.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrawlParamsPreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Suggested crawl parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crawl": {
      "post": {
        "tags": [
          "Crawl & Map"
        ],
        "operationId": "createCrawl",
        "summary": "Start a polite breadth-first site crawl",
        "description": "Starts an asynchronous (or `sync: true`) multi-page crawl enforcing `robots.txt`, path filters, per-host pacing, optional D1 FTS5 indexing (`collectionId`), and HMAC-SHA256 webhook delivery.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrawlRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Completed synchronous crawl job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlCreateResponse"
                }
              }
            }
          },
          "202": {
            "description": "Queued asynchronous crawl job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrawlCreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crawl/{crawlId}": {
      "get": {
        "tags": [
          "Crawl & Map"
        ],
        "operationId": "getCrawl",
        "summary": "Poll crawl job progress and paged results",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "crawlId",
            "in": "path",
            "required": true,
            "description": "Crawl job identifier (`crw_...`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Crawl status and crawled pages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Crawl job not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Crawl & Map"
        ],
        "operationId": "cancelCrawl",
        "summary": "Cancel an active crawl job",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "parameters": [
          {
            "name": "crawlId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Crawl cancelled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Crawl job not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/search": {
      "post": {
        "tags": [
          "Search & Collections"
        ],
        "operationId": "searchWeb",
        "summary": "Search the web and private D1 FTS5 collections",
        "description": "Runs EdgeFetch’s edge-first search waterfall across private `SEARCH` D1 FTS5 collections, `$0` `site:` edge-map discovery, 24h SERP cache, and configured Serper / SearXNG / Tavily / Brave providers, with optional live page chunking.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ranked web and collection search results.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/collections/{collectionId}/search": {
      "get": {
        "tags": [
          "Search & Collections"
        ],
        "operationId": "searchCollectionGet",
        "summary": "Query an indexed D1 FTS5 collection via GET",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "collectionId",
            "in": "path",
            "required": true,
            "description": "Collection identifier (e.g. `default` or `crw_...`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Keyword search query (`query` is also accepted).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Alias for `q`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          },
          {
            "name": "visibility",
            "in": "query",
            "required": false,
            "description": "Index isolation visibility (`\"private\"` searches the authenticated user private collection).",
            "schema": {
              "type": "string",
              "enum": [
                "public",
                "private"
              ],
              "default": "public"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "BM25-ranked FTS5 hits.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CollectionSearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Search & Collections"
        ],
        "operationId": "searchCollectionPost",
        "summary": "Query an indexed D1 FTS5 collection via POST",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "collectionId",
            "in": "path",
            "required": true,
            "description": "Collection identifier (e.g. `default` or `crw_...`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CollectionSearchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "BM25-ranked FTS5 hits.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CollectionSearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/ingest-tab": {
      "post": {
        "tags": [
          "Scraping & Extraction"
        ],
        "operationId": "ingestBrowserTab",
        "summary": "Clip and index an authenticated user browser tab into D1 FTS5",
        "description": "Accepts HTML or Markdown captured directly by a user-initiated browser extension clip (up to 4 MiB), converts main content to clean Markdown, and indexes chunks into `collectionId`.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestTabRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cleaned Markdown and indexed chunk count.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestTabResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs": {
      "post": {
        "tags": [
          "Vertical Intelligence"
        ],
        "operationId": "searchOrVerifyJobs",
        "summary": "Search or batch-verify structured ATS job postings",
        "description": "Searches official ATS boards (Greenhouse, Ashby, Lever, Workday CXS, Workable, Gem, Rippling, SmartRecruiters, company domain auto-discovery, and Built In) with normalized compensation (`base` vs `ote`), OR batch-verifies saved job URLs (`mode: \"verify\"`).",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Normalized job postings or batch verification statuses.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/catalog": {
      "post": {
        "tags": [
          "Vertical Intelligence"
        ],
        "operationId": "extractOrDiffCatalog",
        "summary": "Extract and diff a Shopify or WooCommerce storefront catalog",
        "description": "Politely extracts full product and variant inventory from Shopify (`/products.json`) or WooCommerce Store API sequentially with `robots.txt` + `Content-Signal` enforcement, shrink guards, and variant-level price/stock diffs.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CatalogRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Catalog snapshot, diff summary, and paged product records.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "202": {
            "description": "Queued asynchronous catalog extraction (`sync: false`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/company": {
      "post": {
        "tags": [
          "Vertical Intelligence"
        ],
        "operationId": "getCompanyProfile",
        "summary": "Build a sourced company profile",
        "description": "Merges the company website (schema.org Organization), Wikidata, SEC EDGAR, GitHub, the official ATS job board, and (when connected) Google Maps place details into one profile with per-field source attribution.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Company profile with `fieldSources`, `sources`, and a Markdown summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/salaries": {
      "post": {
        "tags": [
          "Vertical Intelligence"
        ],
        "operationId": "aggregateSalaries",
        "summary": "Aggregate employer-posted pay ranges for a job title",
        "description": "Percentiles and breakdowns (seniority, location, company) over pay ranges employers posted on official ATS boards, with sample postings. Runs a fresh jobs search when data is thin or `refresh` is true.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalariesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Salary report (stats, breakdowns, sample, notes, Markdown).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/catalog/{catalogId}": {
      "get": {
        "tags": [
          "Vertical Intelligence"
        ],
        "operationId": "getCatalogStatus",
        "summary": "Get catalog extraction status and snapshot diff summary",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "catalogId",
            "in": "path",
            "required": true,
            "description": "Catalog run ID (`cat_...`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Catalog run metadata and snapshot diff summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Catalog run not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/catalog/{catalogId}/records": {
      "get": {
        "tags": [
          "Vertical Intelligence"
        ],
        "operationId": "getCatalogRecords",
        "summary": "Page and filter normalized products from a catalog run",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "catalogId",
            "in": "path",
            "required": true,
            "description": "Catalog run ID (`cat_...`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 50
            }
          },
          {
            "name": "vendor",
            "in": "query",
            "required": false,
            "description": "Filter by vendor/brand (repeatable).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "productType",
            "in": "query",
            "required": false,
            "description": "Filter by productType (repeatable).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "availableOnly",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Keyword filter across title, handle, vendor, tags, and SKUs.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Short alias for `query` keyword filter.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Filtered catalog product records.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Catalog run not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/agent": {
      "post": {
        "tags": [
          "Autonomous Agent"
        ],
        "operationId": "runAgent",
        "summary": "Run autonomous multi-step web research and structured JSON extraction",
        "description": "Executes a multi-step research loop with BYO-LLM (OpenAI, Anthropic, Gemini, OpenRouter, Workers AI, or local Ollama/vLLM), routing across all 49+ keyless site adapters with optional JSON Schema validation, SSE streaming (`Accept: text/event-stream`), and Zero Data Retention.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Completed agent research output (or `text/event-stream` when requested).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "202": {
            "description": "Accepted asynchronous agent run (`agt_...`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/agent/{agentId}": {
      "get": {
        "tags": [
          "Autonomous Agent"
        ],
        "operationId": "getAgentRun",
        "summary": "Get autonomous agent run status and output",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "description": "Agent run ID (`agt_...`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agent run status, citations, and structured output.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Agent run not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Autonomous Agent"
        ],
        "operationId": "cancelAgentRun",
        "summary": "Cancel a running autonomous agent task",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agent run cancelled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelJobResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Agent run not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/agent/{agentId}/trace": {
      "get": {
        "tags": [
          "Autonomous Agent"
        ],
        "operationId": "getAgentTrace",
        "summary": "Get step-by-step execution trace spans for an agent run",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "description": "Agent run ID (`agt_...`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ordered execution trace spans.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Agent run not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/mcp/catalog": {
      "get": {
        "tags": [
          "Coordinator & MCP"
        ],
        "operationId": "listOfficialVendorMcpCatalog",
        "summary": "List curated Official Vendor Remote MCP Catalog (26 vendors)",
        "description": "Returns the curated 26 Official Vendor Remote MCP catalog entries with readOnlyOnly lock flags, endpoints, transports, and supported domains.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Curated Official Vendor Remote MCP catalog list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/mcp/registry": {
      "get": {
        "tags": [
          "Coordinator & MCP"
        ],
        "operationId": "discoverMcpRegistry",
        "summary": "Search Official Vendor Catalog, Official MCP Registry, and Community Directories",
        "description": "Queries the curated 26-vendor Official Remote MCP catalog alongside `registry.modelcontextprotocol.io`, `glama.ai`, and PulseMCP via `SAFE_PUBLIC_FETCH`, fusing server manifests, remote Streamable HTTP/SSE endpoints, trustTier/untrusted flags, and associated web domains.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Search keyword, service name, or domain.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Alias for `q`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "remoteOnly",
            "in": "query",
            "required": false,
            "description": "When `true`, return only servers advertising remote `streamable-http` or `sse` endpoints.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum registry entries to return (`1..100`, default `20`).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Normalized multi-source MCP catalog and registry search results.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/mcp/shared": {
      "get": {
        "tags": [
          "Coordinator & MCP"
        ],
        "operationId": "listSharedMcpServers",
        "summary": "List MCP servers other hub users shared with the caller",
        "description": "Returns name, slug, and cached tools of connected MCP servers shared with the caller via the hub access policy. Remote URLs, auth summaries, and credentials are never returned; call tools through `POST /v1/mcp/query` with `server: \"<ownerUserId>/<slug>\"`.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Servers shared with the caller.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/mcp/query": {
      "post": {
        "tags": [
          "Coordinator & MCP"
        ],
        "operationId": "queryConnectedMcp",
        "summary": "List or invoke tools on a user-connected federated MCP server",
        "description": "Executes `list_connected`, `list_tools`, or `call_tool` over Streamable HTTP / legacy HTTP+SSE / virtual OAuth REST against a user-isolated `AES-256-GCM` vault connector, auto-refreshing OAuth 2.1 tokens, enforcing vendor readOnlyOnly locks and writeConsent, and scrubbing indirect prompt injections (`visibility: \"private\"`). Requires OAuth scope `mcp:call` (or `CALLER_TOKEN` / `MCP_TOKEN`) when `action` is `\"list_tools\"` or `\"call_tool\"`.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read",
              "mcp:call"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpTool_QueryMcpInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sanitized private federated MCP result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericOkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/agents": {
      "get": {
        "tags": [
          "System"
        ],
        "operationId": "listAgents",
        "summary": "List connected outbound worker nodes",
        "description": "Lists connected Go worker nodes (`siteId`, CPU architecture, version, `LITE` vs `FAT` browser/PDF capabilities, and job counters). Requires `CALLER_TOKEN`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Connected worker fleet summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentsListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/fetch": {
      "post": {
        "tags": [
          "Coordinator & MCP"
        ],
        "operationId": "dispatchFetch",
        "summary": "Dispatch a coordinated low-level fetch batch",
        "description": "Dispatches 1..N structured fetch requests across connected remote Go worker nodes with LRU load balancing, host-affinity pinning, `429` cooldown failover, `robots.txt` validation, and optional R2 artifact hydration. Requires `CALLER_TOKEN`.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "target",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "auto",
                "agent",
                "container"
              ],
              "default": "auto"
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "description": "Optional worker `siteId` pin when `target=agent`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artifacts",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "transient",
                "stored",
                "off"
              ]
            }
          },
          {
            "name": "hydrate",
            "in": "query",
            "required": false,
            "description": "Hydrate R2 artifact bodies inline (default `true`).",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoordinatorFetchCall"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Coordinator batch fetch reply with per-URL status, timing, and classification outcome.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoordinatorFetchReply"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "tags": [
          "Coordinator & MCP"
        ],
        "operationId": "handleMcpJsonRpc",
        "summary": "Streamable HTTP Model Context Protocol (MCP) JSON-RPC endpoint",
        "description": "Stateless Streamable HTTP MCP endpoint supporting protocol versions `2026-07-28` through `2024-11-05` (`initialize`, `tools/list`, `tools/call`, `server/discover`, `ping`) across all 17 canonical EdgeFetch tools.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:read",
              "crawl:fetch",
              "mcp:call"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpJsonRpcRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpJsonRpcResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted JSON-RPC notification."
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/scrape": {
      "post": {
        "tags": [
          "Compatibility"
        ],
        "operationId": "compatV2Scrape",
        "summary": "Firecrawl v2 compatible single-URL scrape",
        "description": "Drop-in Firecrawl v2 `POST /v2/scrape` compatibility endpoint returning `{ \"success\": true, \"data\": ... }`.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScrapeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Firecrawl v2 compatible scrape envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompatSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/crawl": {
      "post": {
        "tags": [
          "Compatibility"
        ],
        "operationId": "compatV2Crawl",
        "summary": "Firecrawl v2 compatible site crawl",
        "description": "Drop-in Firecrawl v2 `POST /v2/crawl` compatibility endpoint.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrawlRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Firecrawl v2 compatible crawl job creation envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompatSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/map": {
      "post": {
        "tags": [
          "Compatibility"
        ],
        "operationId": "compatV2Map",
        "summary": "Firecrawl v2 compatible site URL map",
        "description": "Drop-in Firecrawl v2 `POST /v2/map` compatibility endpoint.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MapRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Firecrawl v2 compatible map envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompatSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/search": {
      "post": {
        "tags": [
          "Compatibility"
        ],
        "operationId": "compatV2Search",
        "summary": "Firecrawl v2 compatible web search",
        "description": "Drop-in Firecrawl v2 `POST /v2/search` compatibility endpoint.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Firecrawl v2 compatible search envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompatSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/extract": {
      "post": {
        "tags": [
          "Compatibility"
        ],
        "operationId": "compatV2Extract",
        "summary": "Firecrawl v2 compatible multi-URL passage extraction",
        "description": "Drop-in Firecrawl v2 `POST /v2/extract` compatibility endpoint.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExtractRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Firecrawl v2 compatible extract envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompatSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/agent": {
      "post": {
        "tags": [
          "Compatibility"
        ],
        "operationId": "compatV2Agent",
        "summary": "Firecrawl v2 compatible autonomous research agent",
        "description": "Drop-in Firecrawl v2 `POST /v2/agent` compatibility endpoint.",
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauth2Pkce": [
              "crawl:fetch"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Firecrawl v2 compatible agent response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompatSuccessResponse"
                }
              }
            }
          },
          "202": {
            "description": "Accepted asynchronous Firecrawl v2 agent job.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompatSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body or invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Bearer token / OAuth 2.1 access token.",
            "headers": {
              "WWW-Authenticate": {
                "description": "RFC 9728 OAuth 2.1 Protected Resource challenge header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient OAuth 2.1 scope (`crawl:read`, `crawl:fetch`, or `mcp:call`) or policy block.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authenticate with `Authorization: Bearer <token>` using your Hub `CALLER_TOKEN`, scoped `MCP_TOKEN`, or an OAuth 2.1 access token (`X-API-Key` is also accepted)."
      },
      "oauth2Pkce": {
        "type": "oauth2",
        "description": "Self-hosted OAuth 2.1 Authorization Code flow with mandatory `S256` PKCE (`code_challenge_method=S256`) and RFC 7591 Dynamic Client Registration (`POST /oauth/register`).",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://edgefetch.dev/oauth/authorize",
            "tokenUrl": "https://edgefetch.dev/oauth/token",
            "refreshUrl": "https://edgefetch.dev/oauth/token",
            "scopes": {
              "crawl:read": "Read capabilities, keyless site adapters, host health, connected worker status, stored R2 artifacts, and search indexes.",
              "crawl:fetch": "Execute polite outbound scrapes, crawls, URL maps, browser interactions, job/catalog extractions, and autonomous agent runs.",
              "mcp:call": "Invoke tools (`action: \"call_tool\"`) on user-connected federated MCP servers via `POST /v1/mcp/query` or MCP `query_mcp`."
            }
          }
        }
      }
    },
    "schemas": {
      "ScrapeRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Public https:// URL to scrape."
          },
          "formats": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "markdown",
                    "text",
                    "summary",
                    "product",
                    "rawBase64",
                    "html",
                    "rawHtml",
                    "links",
                    "images",
                    "branding",
                    "records",
                    "llmsTxt",
                    "screenshot",
                    "changes",
                    "changeTracking"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "json",
                        "attributes",
                        "screenshot",
                        "changeTracking"
                      ]
                    },
                    "prompt": {
                      "type": "string",
                      "description": "Optional extraction instruction when type=\"json\" (requires an LLM provider)."
                    },
                    "schema": {
                      "type": "object",
                      "description": "Optional JSON Schema object when type=\"json\". Without an LLM configured, schema extraction is structural/heuristic (matching JSON-LD, headings, definition lists, and key-value lines, setting unmatched fields to null); use the agent tool for semantic LLM extraction."
                    },
                    "selectors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "selector": {
                            "type": "string"
                          },
                          "attribute": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "selector",
                          "attribute"
                        ]
                      }
                    },
                    "fullPage": {
                      "type": "boolean"
                    },
                    "quality": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 100
                    },
                    "modes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "tag": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type"
                  ]
                }
              ]
            },
            "default": [
              "markdown"
            ],
            "description": "Desired output formats (e.g. [\"markdown\", \"links\"] or [{ type: \"json\", schema }]). Note: keyless { type: \"json\", schema } extraction is structural/heuristic; prefer agent for semantic extraction."
          },
          "renderMode": {
            "type": "string",
            "enum": [
              "off",
              "auto",
              "always",
              "browser"
            ],
            "default": "auto",
            "description": "\"auto\" (default) fetches static HTML first and only launches a headless browser on thin JavaScript-driven pages; \"off\" never uses a browser; \"always\" or \"browser\" forces headless browser rendering."
          },
          "waitForMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 15000,
            "description": "Extra JavaScript settle wait in milliseconds when rendering in a browser."
          },
          "waitSelector": {
            "type": "string",
            "description": "Optional CSS selector to wait for when rendering in a browser."
          },
          "maxPages": {
            "type": "integer",
            "minimum": 1,
            "maximum": 500,
            "description": "Maximum PDF pages to extract."
          },
          "ocr": {
            "type": "string",
            "enum": [
              "auto",
              "always",
              "off"
            ],
            "default": "auto",
            "description": "PDF OCR mode: \"auto\" runs OCR only on scanned/image-only PDFs; \"always\" forces OCR; \"off\" disables OCR."
          },
          "onlyMainContent": {
            "type": "boolean",
            "default": true,
            "description": "Strip navigation, footer, and sidebar chrome to keep primary article content."
          },
          "includeTags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional HTML tag, #id, or .class selectors (e.g. [\"article\", \"#content\"]) to keep exclusively. Heading-only matches automatically expand to include their section prose."
          },
          "excludeTags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional HTML tag, #id, or .class selectors (e.g. [\".comments\", \"aside\"]) to remove before Markdown conversion."
          },
          "includeImages": {
            "type": "boolean",
            "default": true,
            "description": "Include content images >=100px (set false to omit inline image links)."
          },
          "maxChars": {
            "type": "integer",
            "minimum": 500,
            "maximum": 500000,
            "description": "Maximum Markdown characters returned inline (default 100000 on MCP; truncates cleanly and returns markdownArtifactId + nextOffset for paging via read_artifact)."
          },
          "discoverLlmsTxt": {
            "type": "boolean",
            "default": true,
            "description": "Check /llms.txt and prefer publisher-provided companion .md files when available."
          },
          "preferOriginMarkdown": {
            "type": "boolean",
            "default": true,
            "description": "Set false to request text/html instead of text/markdown from servers that negotiate Markdown directly."
          },
          "maxAgeMs": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "description": "Return a cached scrape result if fetched with the same options within maxAgeMs milliseconds."
          },
          "redactPii": {
            "type": "boolean",
            "default": false,
            "description": "Redact email addresses, phone numbers, and US SSNs from extracted text."
          },
          "checkPromptInjection": {
            "type": "boolean",
            "default": false,
            "description": "When true, rejects pages containing prompt-injection override directives with HTTP 403."
          },
          "mobile": {
            "type": "boolean",
            "default": false,
            "description": "Emulate a 390x844 mobile viewport in headless browser mode."
          },
          "location": {
            "type": "object",
            "properties": {
              "country": {
                "type": "string"
              },
              "languages": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "actions": {
            "type": "array",
            "maxItems": 50,
            "description": "Optional browser actions to run before scraping (wait, click, write, fill, press, scroll, hover, observe, screenshot, scrape, executeJavascript, pdf).",
            "items": {
              "type": "object"
            }
          },
          "parsers": {
            "type": "array",
            "description": "Optional PDF parser controls (e.g. [{ type: \"pdf\", mode: \"auto\", pages: true, pageMarkers: true }] or [] for raw base64).",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object"
                }
              ]
            }
          },
          "query": {
            "type": "string",
            "description": "Optional focus query to surface only the most relevant passages."
          },
          "jsonFilter": {
            "type": "string",
            "description": "Optional filter for JSON array responses (e.g. `title~\"Engineer\"` or `id=abc123`), emitting one chunk per matching record."
          },
          "collectionId": {
            "type": "string",
            "description": "Optional collection ID to index the extracted Markdown into for search_collection."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "default": "public",
            "description": "Cache and storage visibility (\"private\" isolates cached content to the current authenticated user)."
          },
          "waybackFallback": {
            "type": "boolean",
            "default": false,
            "description": "Opt-in Internet Archive Wayback Machine fallback strictly on 5xx errors or unreachable hosts (never used on robots.txt blocks, 401/403/429, or bot challenges)."
          },
          "spaFallback": {
            "type": "string",
            "enum": [
              "auto",
              "off",
              "crawl4ai",
              "firecrawl"
            ],
            "default": "auto",
            "description": "Optional external SPA renderer fallback when configured on the server (never used on robots.txt blocks, 403/429, or bot challenges)."
          },
          "blockTrackers": {
            "type": "boolean",
            "default": true,
            "description": "Abort third-party tracking subresources during headless Chromium renders using the Hub EasyPrivacy host list (default true when loaded; set false to disable for this request only)."
          },
          "allowPageKeyTwins": {
            "type": "boolean",
            "default": true,
            "description": "Resolve embedded front-end page-key API twins (algolia, bazaarvoice, powerreviews, yext-locator). Defaults to true; set false to disable and fall back to HTML/JSON-LD."
          },
          "apiKeys": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Optional per-call official API key overrides keyed by provider or adapter ID (e.g. { \"api-data-gov\": \"...\" }). Forces visibility=\"private\" and never enters shared cache."
          },
          "target": {
            "type": "string",
            "enum": [
              "auto",
              "agent",
              "container"
            ],
            "default": "auto"
          },
          "site": {
            "type": "string",
            "description": "Optional worker site ID when target=\"agent\"."
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      },
      "ExtractRequest": {
        "type": "object",
        "properties": {
          "urls": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "maxItems": 20,
            "description": "1 to 20 public https:// URLs to extract passages from."
          },
          "query": {
            "type": "string",
            "description": "Keyword or question used to rank the most relevant passages per URL (heuristic BM25 keyword ranking; returns noRelevantMatch: true when zero query terms match)."
          },
          "jsonFilter": {
            "type": "string",
            "description": "Optional filter for JSON array responses (e.g. `title~\"Engineer\"` or `id=abc123`), emitting one chunk per matching record."
          },
          "renderMode": {
            "type": "string",
            "enum": [
              "off",
              "auto",
              "always",
              "browser"
            ],
            "default": "auto",
            "description": "\"auto\" (default) renders thin JavaScript-driven pages in a headless browser; \"off\" disables browser rendering; \"always\" forces it."
          },
          "chunksPerSource": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10,
            "default": 3,
            "description": "Maximum ranked chunks returned per URL."
          },
          "includeRawContent": {
            "type": "boolean",
            "default": false,
            "description": "Set true to also include combined Markdown in rawContent on each result (omitted by default to avoid duplicating chunk text)."
          },
          "maxAgeMs": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "description": "Reuse cached Markdown if fetched within maxAgeMs milliseconds."
          },
          "redactPii": {
            "type": "boolean",
            "default": false,
            "description": "Redact email addresses, phone numbers, and US SSNs."
          },
          "collectionId": {
            "type": "string",
            "description": "Optional collection ID to index extracted pages into for search_collection."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "default": "public",
            "description": "Cache and index isolation mode (\"private\" isolates data to the authenticated user)."
          },
          "waybackFallback": {
            "type": "boolean",
            "default": false,
            "description": "Opt-in Internet Archive Wayback Machine fallback strictly on 5xx errors or unreachable hosts (never used on robots.txt blocks, 401/403/429, or bot challenges)."
          },
          "spaFallback": {
            "type": "string",
            "enum": [
              "auto",
              "off",
              "crawl4ai",
              "firecrawl"
            ],
            "default": "auto",
            "description": "Optional external SPA renderer fallback when configured on the server (never used on robots.txt blocks, 403/429, or bot challenges)."
          },
          "blockTrackers": {
            "type": "boolean",
            "default": true,
            "description": "Abort third-party tracking subresources during headless Chromium renders using the Hub EasyPrivacy host list (default true when loaded; set false to disable for this request only)."
          },
          "allowPageKeyTwins": {
            "type": "boolean",
            "default": true,
            "description": "Resolve embedded front-end page-key API twins (algolia, bazaarvoice, powerreviews, yext-locator). Defaults to true; set false to disable and fall back to HTML/JSON-LD."
          },
          "apiKeys": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Optional per-call official API key overrides keyed by provider or adapter ID (e.g. { \"api-data-gov\": \"...\" }). Forces visibility=\"private\" and never enters shared cache."
          },
          "target": {
            "type": "string",
            "enum": [
              "auto",
              "agent",
              "container"
            ],
            "default": "auto"
          },
          "site": {
            "type": "string",
            "description": "Optional worker site ID when target=\"agent\"."
          }
        },
        "required": [
          "urls"
        ],
        "additionalProperties": false
      },
      "InteractRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Initial public https:// URL (omit when resuming or closing an existing sessionId)."
          },
          "sessionId": {
            "type": "string",
            "description": "Session token returned from a prior interact call with keepSession=true."
          },
          "keepSession": {
            "type": "boolean",
            "default": false,
            "description": "Keep the isolated browser tab open for follow-up interact calls."
          },
          "closeSession": {
            "type": "boolean",
            "default": false,
            "description": "Close an open browser session after this call."
          },
          "actions": {
            "type": "array",
            "maxItems": 25,
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "observe",
                    "click",
                    "fill",
                    "type",
                    "press",
                    "wait",
                    "scroll",
                    "select",
                    "hover",
                    "navigate"
                  ]
                },
                "selector": {
                  "type": "string"
                },
                "ref": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 300,
                  "description": "Element number from the latest observe action (alternative to selector for click, fill, type, select, press, hover, scroll). Refs expire on navigation; a stale_ref error means call observe again."
                },
                "value": {
                  "type": "string"
                },
                "key": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "waitMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 15000
                }
              },
              "required": [
                "type"
              ],
              "additionalProperties": false
            }
          },
          "formats": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "markdown",
                "html",
                "rawHtml",
                "screenshot",
                "transcript"
              ]
            },
            "default": [
              "markdown"
            ]
          },
          "waitForMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 15000,
            "description": "Milliseconds to wait for page state to settle."
          },
          "waitSelector": {
            "type": "string",
            "description": "Optional CSS selector to wait for before extracting output."
          },
          "maxChars": {
            "type": "integer",
            "minimum": 100,
            "maximum": 500000,
            "description": "Maximum Markdown characters to return in this call (returns totalChars, remainingChars, and nextOffset when truncated)."
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "description": "Character offset into the rendered Markdown for paging large pages."
          },
          "blockTrackers": {
            "type": "boolean",
            "default": true,
            "description": "Abort third-party tracking subresources during headless Chromium renders using the Hub EasyPrivacy host list (default true when loaded; set false to disable for this request only)."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "default": "public",
            "description": "Cache and storage visibility (\"private\" disables shared artifact persistence and isolates responses to the authenticated user)."
          },
          "site": {
            "type": "string",
            "description": "Optional browser-capable worker site ID."
          }
        },
        "additionalProperties": false
      },
      "MapRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Root public https:// URL of the site to map."
          },
          "search": {
            "type": "string",
            "description": "Optional keyword filter to rank and narrow discovered URLs."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5000,
            "default": 500
          },
          "includeSubdomains": {
            "type": "boolean",
            "default": false
          },
          "includeOutsidePath": {
            "type": "boolean",
            "default": false,
            "description": "When false (default), restricts discovered URLs to the root URL path prefix when url includes a subpath."
          },
          "ignoreSitemap": {
            "type": "boolean",
            "default": false
          },
          "target": {
            "type": "string",
            "enum": [
              "auto",
              "agent",
              "container"
            ],
            "default": "auto"
          },
          "site": {
            "type": "string",
            "description": "Optional worker site ID when target=\"agent\"."
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      },
      "SearchRequest": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Search query, 1-500 characters. Supports site:domain.com (and site:<lang>.wikipedia.org)."
          },
          "maxResults": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20,
            "default": 5,
            "description": "Maximum search results to return (1..20)."
          },
          "timeRange": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month",
              "year"
            ],
            "description": "Optional recency filter."
          },
          "includeDomains": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Restrict results to these domains."
          },
          "excludeDomains": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Exclude results from these domains."
          },
          "includeRawContent": {
            "type": "boolean",
            "default": false,
            "description": "When true, fetches the top result URLs and attaches ranked Markdown chunks."
          },
          "checkPromptInjection": {
            "type": "boolean",
            "default": false,
            "description": "Drop results flagged for prompt injection (they are always flagged)."
          },
          "chunksPerSource": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10,
            "default": 3,
            "description": "Maximum Markdown chunks attached per result when includeRawContent is true."
          },
          "mode": {
            "type": "string",
            "enum": [
              "waterfall",
              "rrf",
              "serper"
            ],
            "description": "rrf: providers in parallel, fused. waterfall: next provider only while results are thin. serper: Serper only."
          },
          "providers": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "serper",
                "brave",
                "searxng",
                "tavily",
                "cloudflare",
                "ceramic"
              ]
            },
            "description": "Optional allowlist of search providers to use."
          },
          "rerank": {
            "type": [
              "boolean",
              "string"
            ],
            "description": "Rerank results: false, true (operator default) or a model such as \"cohere/rerank-5-fast\"."
          },
          "detail": {
            "type": "string",
            "enum": [
              "compact",
              "standard",
              "full"
            ],
            "default": "standard",
            "description": "compact: title, URL, short snippet, score. full: adds score breakdown."
          },
          "collectionId": {
            "type": "string",
            "description": "Optional indexed collection ID to merge into search results."
          },
          "noCache": {
            "type": "boolean",
            "default": false,
            "description": "Set true to bypass cached search results and fetch fresh results."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "default": "public",
            "description": "Cache and search isolation mode (\"private\" isolates search and collection results to the authenticated user)."
          }
        },
        "required": [
          "query"
        ],
        "additionalProperties": true
      },
      "JobsRequest": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Role or keyword query (e.g. \"Forward Deployed Engineer\", \"Solutions Architect\")."
          },
          "company": {
            "type": "string",
            "description": "Optional company name or job-board organization slug."
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 10,
            "description": "Optional company domains (e.g. [\"cloudflare.com\", \"stripe.com\"]) to probe /careers and /jobs for official job-board discovery."
          },
          "remote": {
            "type": "boolean",
            "description": "When true, keep only remote-eligible roles."
          },
          "locations": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional location substrings to match (e.g. [\"United States\", \"Remote\", \"New York\"])."
          },
          "minBase": {
            "type": "number",
            "minimum": 0,
            "description": "Minimum annual base salary filter."
          },
          "minBaseMode": {
            "type": "string",
            "enum": [
              "floor",
              "ceiling",
              "overlap"
            ],
            "default": "floor",
            "description": "How minBase compares against salary ranges: \"floor\" (pay.min >= minBase) or \"overlap\" / \"ceiling\" (pay.max >= minBase)."
          },
          "strictPay": {
            "type": "boolean",
            "default": false,
            "description": "When true and minBase is set, exclude postings that do not list compensation."
          },
          "postedWithinDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365,
            "description": "Keep postings published within the last N days."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50,
            "default": 20
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "description": "Board pagination offset for paging large job boards (e.g. pass 100 after reading 0..99)."
          },
          "cursor": {
            "type": "string",
            "description": "Pagination cursor returned in nextCursor from a previous truncated jobs response."
          },
          "includeBuiltIn": {
            "type": "boolean",
            "default": true,
            "description": "Include Built In job listings (disabled automatically when company or domains is set)."
          },
          "includePublicFeeds": {
            "type": "boolean",
            "default": false,
            "description": "Opt in to public remote job feeds (We Work Remotely, Himalayas, Working Nomads)."
          },
          "mode": {
            "type": "string",
            "enum": [
              "search",
              "verify"
            ],
            "description": "Execution mode (\"search\" default, or \"verify\" to batch-check whether saved job URLs are still live)."
          },
          "verify": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "description": "Saved https:// job posting URLs to batch-verify (\"live\" | \"closed\" | \"board_gone\" | \"unknown\")."
          },
          "urls": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "description": "Alias for verify when mode=\"verify\"."
          },
          "exclude": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "company": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "description": "Optional list of roles to exclude from results."
          },
          "target": {
            "type": "string",
            "enum": [
              "auto",
              "agent",
              "container"
            ],
            "default": "auto"
          },
          "site": {
            "type": "string",
            "description": "Optional worker site ID when target=\"agent\"."
          }
        },
        "additionalProperties": false
      },
      "CatalogRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Public https:// storefront or collection URL (omit when paging an existing catalogId)."
          },
          "catalogId": {
            "type": "string",
            "description": "Existing catalog run ID (`cat_...`) to poll status or page/filter product records."
          },
          "platform": {
            "type": "string",
            "enum": [
              "auto",
              "shopify",
              "woocommerce"
            ],
            "default": "auto",
            "description": "Storefront platform (\"auto\" detects Shopify vs WooCommerce)."
          },
          "collection": {
            "type": "string",
            "description": "Optional collection or category slug."
          },
          "fields": {
            "type": "string",
            "enum": [
              "full",
              "lean"
            ],
            "default": "full",
            "description": "\"full\" includes descriptions and images; \"lean\" returns compact pricing, SKU, and availability fields."
          },
          "maxPages": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200,
            "description": "Maximum catalog pages to fetch sequentially."
          },
          "pauseMs": {
            "type": "integer",
            "minimum": 500,
            "maximum": 30000,
            "description": "Polite pause between sequential pages in milliseconds."
          },
          "sync": {
            "type": "boolean",
            "default": true,
            "description": "Set false to run in the background and poll with catalogId."
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "description": "Record offset when paging an existing catalogId."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 250,
            "description": "Maximum records to return when paging an existing catalogId (default 50)."
          },
          "vendor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "description": "Optional vendor/brand filter when paging catalogId records."
          },
          "productType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "description": "Optional productType filter when paging catalogId records."
          },
          "availableOnly": {
            "type": "boolean",
            "description": "When true, keep only products with at least one in-stock variant."
          },
          "query": {
            "type": "string",
            "description": "Optional keyword filter across title, handle, vendor, tags, and SKUs when paging catalogId."
          },
          "target": {
            "type": "string",
            "enum": [
              "auto",
              "agent",
              "container"
            ],
            "default": "auto"
          },
          "site": {
            "type": "string",
            "description": "Optional worker site ID when target=\"agent\"."
          }
        },
        "additionalProperties": false
      },
      "CompanyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Company name (e.g. \"Cloudflare\"). Provide name and/or domain."
          },
          "domain": {
            "type": "string",
            "description": "Company website domain (e.g. \"cloudflare.com\"); strongly recommended for accurate matching."
          },
          "includeHiring": {
            "type": "boolean",
            "default": true,
            "description": "Include the official ATS hiring summary (open roles, locations, sample titles)."
          },
          "includePlaces": {
            "type": "boolean",
            "default": true,
            "description": "Include Google Maps place details when a Google Maps MCP server is connected."
          }
        },
        "additionalProperties": false
      },
      "SalariesRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Job title (e.g. \"Senior Software Engineer\", \"Solutions Engineer\")."
          },
          "location": {
            "type": "string",
            "description": "Optional location (\"Remote\", \"United States\", \"New York, NY\", \"London\")."
          },
          "seniority": {
            "type": "string",
            "description": "Optional seniority filter (junior, mid, senior, staff, principal, manager, director, ...)."
          },
          "company": {
            "type": "string",
            "description": "Optional company filter."
          },
          "currency": {
            "type": "string",
            "description": "Optional ISO 4217 currency (defaults to the most common in the matches)."
          },
          "basis": {
            "type": "string",
            "enum": [
              "base",
              "total",
              "ote",
              "all"
            ],
            "description": "Pay basis filter (default: base when enough base ranges exist)."
          },
          "maxAgeDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 730,
            "description": "Only use postings seen within this many days (default 180)."
          },
          "refresh": {
            "type": "boolean",
            "default": false,
            "description": "Run a fresh jobs search first to collect new observations."
          }
        },
        "required": [
          "title"
        ],
        "additionalProperties": false
      },
      "BatchScrapeRequest": {
        "type": "object",
        "properties": {
          "urls": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "maxItems": 100,
            "description": "1..100 public https:// URLs to scrape."
          },
          "ignoreInvalidURLs": {
            "type": "boolean",
            "default": false,
            "description": "Skip invalid URLs instead of rejecting the batch with HTTP 400."
          },
          "sync": {
            "type": "boolean",
            "default": false,
            "description": "Wait for completion and return scraped `data` inline."
          },
          "formats": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "markdown",
                    "text",
                    "summary",
                    "product",
                    "rawBase64",
                    "html",
                    "rawHtml",
                    "links",
                    "images",
                    "branding",
                    "records",
                    "llmsTxt",
                    "screenshot",
                    "changes",
                    "changeTracking"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "json",
                        "attributes",
                        "screenshot",
                        "changeTracking"
                      ]
                    },
                    "prompt": {
                      "type": "string",
                      "description": "Optional extraction instruction when type=\"json\" (requires an LLM provider)."
                    },
                    "schema": {
                      "type": "object",
                      "description": "Optional JSON Schema object when type=\"json\". Without an LLM configured, schema extraction is structural/heuristic (matching JSON-LD, headings, definition lists, and key-value lines, setting unmatched fields to null); use the agent tool for semantic LLM extraction."
                    },
                    "selectors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "selector": {
                            "type": "string"
                          },
                          "attribute": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "selector",
                          "attribute"
                        ]
                      }
                    },
                    "fullPage": {
                      "type": "boolean"
                    },
                    "quality": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 100
                    },
                    "modes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "tag": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type"
                  ]
                }
              ]
            },
            "default": [
              "markdown"
            ],
            "description": "Desired output formats (e.g. [\"markdown\", \"links\"] or [{ type: \"json\", schema }]). Note: keyless { type: \"json\", schema } extraction is structural/heuristic; prefer agent for semantic extraction."
          },
          "renderMode": {
            "type": "string",
            "enum": [
              "off",
              "auto",
              "always",
              "browser"
            ],
            "default": "auto",
            "description": "\"auto\" (default) fetches static HTML first and only launches a headless browser on thin JavaScript-driven pages; \"off\" never uses a browser; \"always\" or \"browser\" forces headless browser rendering."
          },
          "onlyMainContent": {
            "type": "boolean",
            "default": true,
            "description": "Strip navigation, footer, and sidebar chrome to keep primary article content."
          },
          "maxAgeMs": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "description": "Return a cached scrape result if fetched with the same options within maxAgeMs milliseconds."
          },
          "redactPii": {
            "type": "boolean",
            "default": false,
            "description": "Redact email addresses, phone numbers, and US SSNs from extracted text."
          },
          "target": {
            "type": "string",
            "enum": [
              "auto",
              "agent",
              "container"
            ],
            "default": "auto"
          },
          "site": {
            "type": "string",
            "description": "Optional worker site ID when target=\"agent\"."
          }
        },
        "required": [
          "urls"
        ],
        "additionalProperties": true
      },
      "CrawlParamsPreviewRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Root public https:// URL to crawl."
          },
          "prompt": {
            "type": "string",
            "description": "Natural-language crawl goal (e.g. \"only /docs and /api, skip /blog, max 50 pages depth 2\")."
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      },
      "CrawlRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Root public https:// URL to start crawling."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200,
            "default": 25,
            "description": "Maximum pages to crawl (1..200)."
          },
          "maxDepth": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5,
            "default": 2,
            "description": "Maximum link hop depth from the root URL."
          },
          "allowSubdomains": {
            "type": "boolean",
            "default": false
          },
          "includePaths": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional path prefixes or regexes to include."
          },
          "excludePaths": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional path prefixes or regexes to skip."
          },
          "collectionId": {
            "type": "string",
            "description": "Optional collection ID to index crawled pages into for search_collection."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "default": "public",
            "description": "Cache and storage visibility (\"private\" isolates crawled pages and indexed collections to the authenticated user)."
          },
          "sync": {
            "type": "boolean",
            "default": false,
            "description": "Wait for crawl completion before returning HTTP 200."
          },
          "webhook": {
            "type": "object",
            "description": "Optional HTTPS webhook signed with `WEBHOOK_SECRET` (HMAC-SHA256).",
            "properties": {
              "url": {
                "type": "string",
                "description": "Public https:// webhook receiver URL."
              },
              "events": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "started",
                    "page",
                    "completed",
                    "failed"
                  ]
                }
              },
              "headers": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            },
            "required": [
              "url"
            ]
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": true
      },
      "CollectionSearchRequest": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Keyword query to match against indexed document chunks."
          },
          "q": {
            "type": "string",
            "description": "Alias for `query`."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50,
            "default": 10,
            "description": "Maximum matching chunks to return (1..50)."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "default": "public",
            "description": "Index isolation visibility (\"private\" searches the authenticated user private collection)."
          }
        },
        "additionalProperties": false
      },
      "IngestTabRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Source http(s) URL of the clipped browser tab."
          },
          "title": {
            "type": "string",
            "description": "Optional page title override."
          },
          "html": {
            "type": "string",
            "description": "Captured DOM HTML (up to 4 MiB)."
          },
          "markdown": {
            "type": "string",
            "description": "Pre-extracted Markdown when HTML is omitted."
          },
          "collectionId": {
            "type": "string",
            "default": "default",
            "description": "Target SEARCH D1 FTS5 collection ID."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "description": "Artifact & FTS5 collection isolation (`private` namespaces R2 & FTS5 under the authenticated `userId`)."
          },
          "onlyMainContent": {
            "type": "boolean",
            "default": true
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      },
      "AgentRequest": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string",
            "description": "Natural-language research question or extraction goal."
          },
          "urls": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional starting public https:// URLs."
          },
          "strictConstrainToURLs": {
            "type": "boolean",
            "default": false,
            "description": "Restrict navigation strictly to the provided seed urls."
          },
          "schema": {
            "type": "object",
            "description": "Optional JSON Schema for semantic structured output validation."
          },
          "effort": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "default": "medium"
          },
          "maxSteps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20
          },
          "maxPages": {
            "type": "integer",
            "minimum": 1,
            "maximum": 40
          },
          "threadId": {
            "type": "string",
            "description": "Optional prior `agt_...` threadId for multi-turn follow-up."
          },
          "zeroDataRetention": {
            "type": "boolean",
            "default": false,
            "description": "When true, skips persisting run history or cached artifacts."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "default": "public",
            "description": "Run and storage visibility (\"private\" isolates run state, memory, and tool scrapes to the authenticated user)."
          },
          "safe": {
            "type": "boolean",
            "default": false
          },
          "location": {
            "type": "object",
            "properties": {
              "country": {
                "type": "string"
              },
              "languages": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "llm": {
            "type": "object",
            "description": "Optional BYO-LLM configuration (e.g. { provider: \"openai\"|\"anthropic\"|\"gemini\"|\"ollama\", model, baseUrl, apiKey }).",
            "properties": {
              "provider": {
                "type": "string"
              },
              "baseUrl": {
                "type": "string"
              },
              "model": {
                "type": "string"
              },
              "apiKey": {
                "type": "string"
              }
            }
          },
          "async": {
            "type": "boolean",
            "description": "Run asynchronously and return `202` with `id` (`agt_...`)."
          },
          "stream": {
            "type": "boolean",
            "description": "Stream real-time Server-Sent Events (`text/event-stream`)."
          }
        },
        "required": [
          "prompt"
        ],
        "additionalProperties": true
      },
      "CoordinatorFetchCall": {
        "type": "object",
        "properties": {
          "maxSeconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 120,
            "default": 30
          },
          "options": {
            "type": "object",
            "properties": {
              "concurrency": {
                "type": "integer",
                "minimum": 1,
                "maximum": 8
              },
              "pauseMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 30000
              },
              "pauseJitterMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 15000
              },
              "respectRobots": {
                "type": "boolean",
                "default": true
              },
              "includeBody": {
                "type": "boolean",
                "default": true
              },
              "maxBytes": {
                "type": "integer",
                "minimum": 256,
                "maximum": 16777216
              },
              "artifactRetention": {
                "type": "string",
                "enum": [
                  "transient",
                  "stored",
                  "off"
                ]
              },
              "collectionId": {
                "type": "string"
              }
            }
          },
          "requests": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "page",
                    "text",
                    "json",
                    "feed",
                    "catalog",
                    "scrape",
                    "render",
                    "pdf",
                    "binary"
                  ]
                },
                "accept": {
                  "type": "string",
                  "enum": [
                    "text/html",
                    "text/markdown",
                    "application/xml",
                    "text/xml",
                    "application/rss+xml",
                    "application/atom+xml",
                    "application/json",
                    "text/calendar",
                    "text/plain"
                  ]
                },
                "ifNoneMatch": {
                  "type": "string"
                },
                "ifModifiedSince": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "url"
              ]
            }
          }
        },
        "required": [
          "requests"
        ]
      },
      "TraceStep": {
        "type": "object",
        "description": "Per-request execution, policy, or active signed adapter pack provenance step.",
        "properties": {
          "step": {
            "type": "string",
            "description": "Trace step identifier (e.g. `robots_bypass`, `adapter_pack`)."
          },
          "outcome": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "hop": {
            "type": "integer",
            "minimum": 0
          },
          "packSeq": {
            "type": "integer",
            "minimum": 0,
            "description": "Active signed adapter pack sequence (`0` when running embedded `compiled.json`)."
          }
        },
        "required": [
          "step"
        ]
      },
      "CoordinatorFetchReply": {
        "type": "object",
        "properties": {
          "packSeq": {
            "type": "integer",
            "minimum": 0,
            "description": "Active signed adapter pack sequence (`0` when running embedded `compiled.json`)."
          },
          "summary": {
            "type": "object"
          },
          "trace": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraceStep"
            }
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "finalUrl": {
                  "type": "string"
                },
                "status": {
                  "type": "integer"
                },
                "outcome": {
                  "type": "string"
                },
                "problem": {
                  "type": "string"
                },
                "contentType": {
                  "type": "string"
                },
                "body": {
                  "type": "string"
                },
                "timing": {
                  "type": "object"
                },
                "artifact": {
                  "type": "object"
                },
                "trace": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TraceStep"
                  }
                }
              }
            }
          }
        }
      },
      "McpJsonRpcRequest": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "type": "string",
            "const": "2.0"
          },
          "id": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "method": {
            "type": "string",
            "description": "MCP method (`initialize`, `tools/list`, `tools/call`, `server/discover`, `ping`)."
          },
          "params": {
            "type": "object",
            "description": "Method parameters (for `tools/call`, `{ name, arguments }` matching one of the `McpTool_*Input` schemas)."
          }
        },
        "required": [
          "jsonrpc",
          "method"
        ]
      },
      "McpJsonRpcResponse": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "type": "string",
            "const": "2.0"
          },
          "id": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "result": {
            "type": "object"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "integer"
              },
              "message": {
                "type": "string"
              },
              "data": {}
            }
          }
        },
        "required": [
          "jsonrpc"
        ]
      },
      "HealthResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "packSeq": {
            "type": "integer",
            "minimum": 0,
            "description": "Active signed adapter pack sequence (`0` when running embedded `compiled.json`)."
          },
          "packExpired": {
            "type": "boolean",
            "description": "True when an already-active signed adapter pack has passed `expiresAt` and continues serving while awaiting refresh."
          }
        },
        "required": [
          "ok",
          "packSeq"
        ]
      },
      "BotManifestResponse": {
        "type": "object",
        "properties": {
          "bot": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "userAgent": {
            "type": "string"
          },
          "operatorContact": {
            "type": "string"
          },
          "policies": {
            "type": "object"
          },
          "webBotAuth": {
            "type": "object"
          }
        }
      },
      "BotKeyDirectoryResponse": {
        "type": "object",
        "properties": {
          "keys": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kty": {
                  "type": "string",
                  "const": "OKP"
                },
                "crv": {
                  "type": "string",
                  "const": "Ed25519"
                },
                "kid": {
                  "type": "string"
                },
                "x": {
                  "type": "string"
                },
                "nbf": {
                  "type": "integer"
                },
                "exp": {
                  "type": "integer"
                }
              },
              "required": [
                "kty",
                "crv",
                "kid",
                "x",
                "nbf"
              ]
            }
          }
        },
        "required": [
          "keys"
        ]
      },
      "OAuthProtectedResourceMetadata": {
        "type": "object",
        "properties": {
          "resource": {
            "type": "string"
          },
          "authorization_servers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "bearer_methods_supported": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "scopes_supported": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "resource_name": {
            "type": "string"
          }
        }
      },
      "OAuthAuthorizationServerMetadata": {
        "type": "object",
        "properties": {
          "issuer": {
            "type": "string"
          },
          "authorization_endpoint": {
            "type": "string"
          },
          "token_endpoint": {
            "type": "string"
          },
          "registration_endpoint": {
            "type": "string"
          },
          "revocation_endpoint": {
            "type": "string"
          },
          "response_types_supported": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "grant_types_supported": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "code_challenge_methods_supported": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "scopes_supported": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CapabilitiesResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "version": {
            "type": "string"
          },
          "storage": {
            "type": "object"
          },
          "search": {
            "type": "object"
          }
        }
      },
      "ExtractorsResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "total": {
            "type": "integer"
          },
          "categories": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "extractors": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "HostsHealthResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "hosts": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "ArtifactPageResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "blobSha256": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "offset": {
            "type": "integer"
          },
          "nextOffset": {
            "type": [
              "integer",
              "null"
            ]
          },
          "hasMore": {
            "type": "boolean"
          },
          "totalChars": {
            "type": "integer"
          }
        }
      },
      "ScrapeResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "packSeq": {
            "type": "integer",
            "minimum": 0,
            "description": "Active signed adapter pack sequence (`0` when running embedded `compiled.json`)."
          },
          "cached": {
            "type": "boolean"
          },
          "url": {
            "type": "string"
          },
          "finalUrl": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "via": {
            "type": "string"
          },
          "rendered": {
            "type": "boolean"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "wordCount": {
            "type": "integer"
          },
          "favicon": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "markdown": {
            "type": "string"
          },
          "json": {
            "type": "object"
          },
          "jsonExtractionMode": {
            "type": "string",
            "enum": [
              "heuristic",
              "llm"
            ]
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "links": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "type": "object"
          },
          "blocked": {
            "type": [
              "object",
              "null"
            ]
          },
          "trace": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraceStep"
            }
          }
        }
      },
      "BatchScrapeStatusResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "packSeq": {
            "type": "integer",
            "minimum": 0
          },
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "completed": {
            "type": "integer"
          },
          "url": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "trace": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraceStep"
            }
          }
        }
      },
      "ExtractResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "packSeq": {
            "type": "integer",
            "minimum": 0
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "failedResults": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "trace": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraceStep"
            }
          }
        }
      },
      "InteractResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "sessionId": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "finalUrl": {
            "type": "string"
          },
          "rendered": {
            "type": "boolean"
          },
          "actions": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "markdown": {
            "type": "string"
          },
          "truncated": {
            "type": "boolean"
          },
          "offset": {
            "type": "integer"
          },
          "totalChars": {
            "type": "integer"
          },
          "remainingChars": {
            "type": "integer"
          },
          "nextOffset": {
            "type": [
              "integer",
              "null"
            ]
          },
          "screenshotBase64": {
            "type": "string"
          },
          "screenshotArtifactId": {
            "type": "string"
          },
          "screenshotMimeType": {
            "type": "string"
          },
          "screenshotBytes": {
            "type": "integer"
          },
          "metadata": {
            "type": "object"
          }
        }
      },
      "MapResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "packSeq": {
            "type": "integer",
            "minimum": 0
          },
          "url": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "links": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "trace": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraceStep"
            }
          }
        }
      },
      "CrawlCreateResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "packSeq": {
            "type": "integer",
            "minimum": 0
          },
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "collectionId": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "trace": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TraceStep"
            }
          }
        }
      },
      "SearchResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "query": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "CollectionSearchResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "collectionId": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "hits": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "IngestTabResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "url": {
            "type": "string"
          },
          "collectionId": {
            "type": "string"
          },
          "indexedChunks": {
            "type": "integer"
          },
          "contentSha256": {
            "type": "string"
          },
          "markdown": {
            "type": "string"
          }
        }
      },
      "AgentsListResponse": {
        "type": "object",
        "properties": {
          "connected": {
            "type": "integer"
          },
          "distinctPublicIps": {
            "type": "integer"
          },
          "trackerListVersion": {
            "type": [
              "string",
              "null"
            ]
          },
          "agents": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "CancelJobResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "const": "cancelled"
          }
        }
      },
      "CompatSuccessResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {}
        },
        "required": [
          "success"
        ]
      },
      "GenericOkResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          }
        },
        "additionalProperties": true
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      },
      "McpTool_ListAgentsInput": {
        "title": "List Connected Crawler Agents (MCP list_agents)",
        "description": "Returns connected crawler worker nodes, their capabilities (HTTP vs headless browser and PDF support), CPU architectures, job counts, and active host routing pins.",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "McpTool_FetchUrlInput": {
        "title": "Low-Level Raw HTTP Fetch (APIs/XML/Headers — Use scrape for Web Pages) (MCP fetch_url)",
        "description": "Fetches a single public HTTPS URL and returns raw, unparsed HTTP body bytes, status code, safe response headers, and timing. Use this ONLY for JSON/XML APIs, raw data files, or HTTP header inspection — NEVER for HTML web pages or articles (use scrape for 1 page or extract for multiple pages instead).",
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Public https:// URL to fetch (port 443)."
          },
          "kind": {
            "type": "string",
            "enum": [
              "feed",
              "json",
              "page",
              "text"
            ],
            "description": "Optional response kind (\"json\" for JSON APIs, \"text\" for XML/RSS/Markdown/plain text, \"feed\" for product JSON feeds, \"page\" for raw HTML). Omit to auto-detect from URL."
          },
          "accept": {
            "type": "string",
            "enum": [
              "text/html",
              "text/markdown",
              "application/xml",
              "text/xml",
              "application/rss+xml",
              "application/atom+xml",
              "application/json",
              "text/calendar",
              "text/plain"
            ],
            "description": "Optional Accept header media type override (defaults automatically based on the URL when omitted)."
          },
          "target": {
            "type": "string",
            "enum": [
              "auto",
              "agent",
              "container"
            ],
            "default": "auto",
            "description": "Execution route (\"auto\" uses connected crawler nodes first with automatic overflow, \"agent\" forces a connected node, \"container\" forces cloud overflow)."
          },
          "site": {
            "type": "string",
            "description": "Optional worker site ID to pin when target=\"agent\"."
          },
          "respectRobots": {
            "type": "boolean",
            "default": true,
            "description": "Respect /robots.txt Allow, Disallow, and Crawl-delay rules."
          },
          "robots": {
            "type": "boolean",
            "description": "Deprecated alias for respectRobots."
          },
          "includeBody": {
            "type": "boolean",
            "default": true,
            "description": "Include the response body preview in tool output."
          },
          "maxBytes": {
            "type": "integer",
            "minimum": 256,
            "maximum": 16777216,
            "description": "Maximum inline preview size in characters/bytes (256..16777216). Larger bodies return an artifactId readable via read_artifact."
          },
          "ifNoneMatch": {
            "type": "string",
            "description": "Optional ETag for conditional 304 Not Modified checks."
          },
          "ifModifiedSince": {
            "type": "string",
            "description": "Optional Last-Modified timestamp for conditional 304 checks."
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      },
      "McpTool_FetchBatchInput": {
        "title": "Batch Fetch Public HTTPS URLs (MCP fetch_batch)",
        "description": "Fetches 1 to 25 public HTTPS URLs in one polite batch and returns per-URL HTTP status, outcome (\"ok\", \"not_found\" for 404, \"gone\" for 410, \"dns_not_found\", \"blocked\", or \"rate_limited\"), headers, and optional raw body previews. Use this for batch API/feed/status checks; prefer extract when you want clean readable passages from web pages.",
        "type": "object",
        "properties": {
          "urls": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "maxItems": 25,
            "description": "1 to 25 public https:// URLs to fetch."
          },
          "kind": {
            "type": "string",
            "enum": [
              "feed",
              "json",
              "page",
              "text"
            ],
            "description": "Optional kind applied to every URL; omit to auto-detect per URL."
          },
          "accept": {
            "type": "string",
            "enum": [
              "text/html",
              "text/markdown",
              "application/xml",
              "text/xml",
              "application/rss+xml",
              "application/atom+xml",
              "application/json",
              "text/calendar",
              "text/plain"
            ],
            "description": "Optional Accept media type for text requests; omit to infer per URL."
          },
          "target": {
            "type": "string",
            "enum": [
              "auto",
              "agent",
              "container"
            ],
            "default": "auto"
          },
          "site": {
            "type": "string",
            "description": "Optional worker site ID when target=\"agent\"."
          },
          "pauseMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 30000,
            "default": 1000,
            "description": "Minimum per-host pause in milliseconds."
          },
          "pauseJitterMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 15000,
            "default": 500,
            "description": "Random positive jitter in milliseconds added to pauseMs."
          },
          "respectRobots": {
            "type": "boolean",
            "default": true
          },
          "robots": {
            "type": "boolean",
            "description": "Deprecated alias for respectRobots."
          },
          "includeBody": {
            "type": "boolean",
            "default": false,
            "description": "Set true to include truncated raw body previews per URL. Either way each successful result carries an artifactId for read_artifact."
          },
          "previewBytes": {
            "type": "integer",
            "minimum": 256,
            "maximum": 65536,
            "default": 3072,
            "description": "Maximum inline body preview characters per URL when includeBody=true (default 3072; full body can be paged via read_artifact)."
          }
        },
        "required": [
          "urls"
        ],
        "additionalProperties": false
      },
      "McpTool_ScrapeInput": {
        "title": "Scrape URL to Markdown & Metadata (MCP scrape)",
        "description": "Reads a single public HTTPS web page, PDF, RSS/Atom feed, OpenAPI spec, or Jupyter notebook and returns clean main-content Markdown plus structured metadata (title, wordCount, favicon, canonicalUrl, contentType, links, and images). Prefer scrape for reading 1 URL, extract for query-focused passages across multiple URLs, and interact when clicking or typing in a browser is required.",
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Public https:// URL to scrape."
          },
          "formats": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "markdown",
                    "text",
                    "summary",
                    "product",
                    "rawBase64",
                    "html",
                    "rawHtml",
                    "links",
                    "images",
                    "branding",
                    "records",
                    "llmsTxt",
                    "screenshot",
                    "changes",
                    "changeTracking"
                  ]
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "json",
                        "attributes",
                        "screenshot",
                        "changeTracking"
                      ]
                    },
                    "prompt": {
                      "type": "string",
                      "description": "Optional extraction instruction when type=\"json\" (requires an LLM provider)."
                    },
                    "schema": {
                      "type": "object",
                      "description": "Optional JSON Schema object when type=\"json\". Without an LLM configured, schema extraction is structural/heuristic (matching JSON-LD, headings, definition lists, and key-value lines, setting unmatched fields to null); use the agent tool for semantic LLM extraction."
                    },
                    "selectors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "selector": {
                            "type": "string"
                          },
                          "attribute": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "selector",
                          "attribute"
                        ]
                      }
                    },
                    "fullPage": {
                      "type": "boolean"
                    },
                    "quality": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 100
                    },
                    "modes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "tag": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type"
                  ]
                }
              ]
            },
            "default": [
              "markdown"
            ],
            "description": "Desired output formats (e.g. [\"markdown\", \"links\"] or [{ type: \"json\", schema }]). Note: keyless { type: \"json\", schema } extraction is structural/heuristic; prefer agent for semantic extraction."
          },
          "renderMode": {
            "type": "string",
            "enum": [
              "off",
              "auto",
              "always",
              "browser"
            ],
            "default": "auto",
            "description": "\"auto\" (default) fetches static HTML first and only launches a headless browser on thin JavaScript-driven pages; \"off\" never uses a browser; \"always\" or \"browser\" forces headless browser rendering."
          },
          "waitForMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 15000,
            "description": "Extra JavaScript settle wait in milliseconds when rendering in a browser."
          },
          "waitSelector": {
            "type": "string",
            "description": "Optional CSS selector to wait for when rendering in a browser."
          },
          "maxPages": {
            "type": "integer",
            "minimum": 1,
            "maximum": 500,
            "description": "Maximum PDF pages to extract."
          },
          "ocr": {
            "type": "string",
            "enum": [
              "auto",
              "always",
              "off"
            ],
            "default": "auto",
            "description": "PDF OCR mode: \"auto\" runs OCR only on scanned/image-only PDFs; \"always\" forces OCR; \"off\" disables OCR."
          },
          "onlyMainContent": {
            "type": "boolean",
            "default": true,
            "description": "Strip navigation, footer, and sidebar chrome to keep primary article content."
          },
          "includeTags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional HTML tag, #id, or .class selectors (e.g. [\"article\", \"#content\"]) to keep exclusively. Heading-only matches automatically expand to include their section prose."
          },
          "excludeTags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional HTML tag, #id, or .class selectors (e.g. [\".comments\", \"aside\"]) to remove before Markdown conversion."
          },
          "includeImages": {
            "type": "boolean",
            "default": true,
            "description": "Include content images >=100px (set false to omit inline image links)."
          },
          "maxChars": {
            "type": "integer",
            "minimum": 500,
            "maximum": 500000,
            "description": "Maximum Markdown characters returned inline (default 100000 on MCP; truncates cleanly and returns markdownArtifactId + nextOffset for paging via read_artifact)."
          },
          "discoverLlmsTxt": {
            "type": "boolean",
            "default": true,
            "description": "Check /llms.txt and prefer publisher-provided companion .md files when available."
          },
          "preferOriginMarkdown": {
            "type": "boolean",
            "default": true,
            "description": "Set false to request text/html instead of text/markdown from servers that negotiate Markdown directly."
          },
          "maxAgeMs": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "description": "Return a cached scrape result if fetched with the same options within maxAgeMs milliseconds."
          },
          "redactPii": {
            "type": "boolean",
            "default": false,
            "description": "Redact email addresses, phone numbers, and US SSNs from extracted text."
          },
          "checkPromptInjection": {
            "type": "boolean",
            "default": false,
            "description": "When true, rejects pages containing prompt-injection override directives with HTTP 403."
          },
          "mobile": {
            "type": "boolean",
            "default": false,
            "description": "Emulate a 390x844 mobile viewport in headless browser mode."
          },
          "location": {
            "type": "object",
            "properties": {
              "country": {
                "type": "string"
              },
              "languages": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "actions": {
            "type": "array",
            "maxItems": 50,
            "description": "Optional browser actions to run before scraping (wait, click, write, fill, press, scroll, hover, observe, screenshot, scrape, executeJavascript, pdf).",
            "items": {
              "type": "object"
            }
          },
          "parsers": {
            "type": "array",
            "description": "Optional PDF parser controls (e.g. [{ type: \"pdf\", mode: \"auto\", pages: true, pageMarkers: true }] or [] for raw base64).",
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object"
                }
              ]
            }
          },
          "query": {
            "type": "string",
            "description": "Optional focus query to surface only the most relevant passages."
          },
          "jsonFilter": {
            "type": "string",
            "description": "Optional filter for JSON array responses (e.g. `title~\"Engineer\"` or `id=abc123`), emitting one chunk per matching record."
          },
          "collectionId": {
            "type": "string",
            "description": "Optional collection ID to index the extracted Markdown into for search_collection."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "default": "public",
            "description": "Cache and storage visibility (\"private\" isolates cached content to the current authenticated user)."
          },
          "waybackFallback": {
            "type": "boolean",
            "default": false,
            "description": "Opt-in Internet Archive Wayback Machine fallback strictly on 5xx errors or unreachable hosts (never used on robots.txt blocks, 401/403/429, or bot challenges)."
          },
          "spaFallback": {
            "type": "string",
            "enum": [
              "auto",
              "off",
              "crawl4ai",
              "firecrawl"
            ],
            "default": "auto",
            "description": "Optional external SPA renderer fallback when configured on the server (never used on robots.txt blocks, 403/429, or bot challenges)."
          },
          "blockTrackers": {
            "type": "boolean",
            "default": true,
            "description": "Abort third-party tracking subresources during headless Chromium renders using the Hub EasyPrivacy host list (default true when loaded; set false to disable for this request only)."
          },
          "allowPageKeyTwins": {
            "type": "boolean",
            "default": true,
            "description": "Resolve embedded front-end page-key API twins (algolia, bazaarvoice, powerreviews, yext-locator). Defaults to true; set false to disable and fall back to HTML/JSON-LD."
          },
          "apiKeys": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Optional per-call official API key overrides keyed by provider or adapter ID (e.g. { \"api-data-gov\": \"...\" }). Forces visibility=\"private\" and never enters shared cache."
          },
          "target": {
            "type": "string",
            "enum": [
              "auto",
              "agent",
              "container"
            ],
            "default": "auto"
          },
          "site": {
            "type": "string",
            "description": "Optional worker site ID when target=\"agent\"."
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      },
      "McpTool_ExtractInput": {
        "title": "Extract Focused Passages from URLs (MCP extract)",
        "description": "Extracts clean, query-ranked Markdown passages across 1 to 20 public HTTPS URLs in one batch. Returns top matching chunks per URL (or noRelevantMatch: true with empty chunks when zero query terms appear on a page). Prefer extract for multi-URL question answering and scrape for reading one full page.",
        "type": "object",
        "properties": {
          "urls": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "maxItems": 20,
            "description": "1 to 20 public https:// URLs to extract passages from."
          },
          "query": {
            "type": "string",
            "description": "Keyword or question used to rank the most relevant passages per URL (heuristic BM25 keyword ranking; returns noRelevantMatch: true when zero query terms match)."
          },
          "jsonFilter": {
            "type": "string",
            "description": "Optional filter for JSON array responses (e.g. `title~\"Engineer\"` or `id=abc123`), emitting one chunk per matching record."
          },
          "renderMode": {
            "type": "string",
            "enum": [
              "off",
              "auto",
              "always",
              "browser"
            ],
            "default": "auto",
            "description": "\"auto\" (default) renders thin JavaScript-driven pages in a headless browser; \"off\" disables browser rendering; \"always\" forces it."
          },
          "chunksPerSource": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10,
            "default": 3,
            "description": "Maximum ranked chunks returned per URL."
          },
          "includeRawContent": {
            "type": "boolean",
            "default": false,
            "description": "Set true to also include combined Markdown in rawContent on each result (omitted by default to avoid duplicating chunk text)."
          },
          "maxAgeMs": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "description": "Reuse cached Markdown if fetched within maxAgeMs milliseconds."
          },
          "redactPii": {
            "type": "boolean",
            "default": false,
            "description": "Redact email addresses, phone numbers, and US SSNs."
          },
          "collectionId": {
            "type": "string",
            "description": "Optional collection ID to index extracted pages into for search_collection."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "default": "public",
            "description": "Cache and index isolation mode (\"private\" isolates data to the authenticated user)."
          },
          "waybackFallback": {
            "type": "boolean",
            "default": false,
            "description": "Opt-in Internet Archive Wayback Machine fallback strictly on 5xx errors or unreachable hosts (never used on robots.txt blocks, 401/403/429, or bot challenges)."
          },
          "spaFallback": {
            "type": "string",
            "enum": [
              "auto",
              "off",
              "crawl4ai",
              "firecrawl"
            ],
            "default": "auto",
            "description": "Optional external SPA renderer fallback when configured on the server (never used on robots.txt blocks, 403/429, or bot challenges)."
          },
          "blockTrackers": {
            "type": "boolean",
            "default": true,
            "description": "Abort third-party tracking subresources during headless Chromium renders using the Hub EasyPrivacy host list (default true when loaded; set false to disable for this request only)."
          },
          "allowPageKeyTwins": {
            "type": "boolean",
            "default": true,
            "description": "Resolve embedded front-end page-key API twins (algolia, bazaarvoice, powerreviews, yext-locator). Defaults to true; set false to disable and fall back to HTML/JSON-LD."
          },
          "apiKeys": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Optional per-call official API key overrides keyed by provider or adapter ID (e.g. { \"api-data-gov\": \"...\" }). Forces visibility=\"private\" and never enters shared cache."
          },
          "target": {
            "type": "string",
            "enum": [
              "auto",
              "agent",
              "container"
            ],
            "default": "auto"
          },
          "site": {
            "type": "string",
            "description": "Optional worker site ID when target=\"agent\"."
          }
        },
        "required": [
          "urls"
        ],
        "additionalProperties": false
      },
      "McpTool_MapInput": {
        "title": "Map Site URLs (MCP map)",
        "description": "Discovers public URLs on a website using sitemaps, /llms.txt, and homepage links, returning a filtered list of links without scraping every page.",
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Root public https:// URL of the site to map."
          },
          "search": {
            "type": "string",
            "description": "Optional keyword filter to rank and narrow discovered URLs."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5000,
            "default": 500
          },
          "includeSubdomains": {
            "type": "boolean",
            "default": false
          },
          "includeOutsidePath": {
            "type": "boolean",
            "default": false,
            "description": "When false (default), restricts discovered URLs to the root URL path prefix when url includes a subpath."
          },
          "ignoreSitemap": {
            "type": "boolean",
            "default": false
          },
          "target": {
            "type": "string",
            "enum": [
              "auto",
              "agent",
              "container"
            ],
            "default": "auto"
          },
          "site": {
            "type": "string",
            "description": "Optional worker site ID when target=\"agent\"."
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      },
      "McpTool_CrawlInput": {
        "title": "Site Crawl (Run / Poll Status / Cancel) (MCP crawl)",
        "description": "Crawls multiple pages of a website breadth-first (respecting robots.txt and path filters) and indexes them into a searchable collection. Small crawls (limit <= 5) wait up to 25 seconds to return completed pages directly; larger or background crawls return a crawlId that you can poll or cancel by calling crawl with { crawlId }.",
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Root public https:// URL to start crawling (omit when polling or cancelling an existing crawlId)."
          },
          "crawlId": {
            "type": "string",
            "description": "Existing crawl ID (`crw_...`) to poll progress/results or cancel."
          },
          "cancel": {
            "type": "boolean",
            "default": false,
            "description": "Set true with crawlId to cancel a running crawl."
          },
          "async": {
            "type": "boolean",
            "description": "Set true to run in the background immediately and return crawlId even when limit <= 5."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200,
            "default": 25,
            "description": "Maximum pages to crawl (1..200)."
          },
          "maxDepth": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5,
            "default": 2,
            "description": "Maximum link hop depth from the root URL."
          },
          "allowSubdomains": {
            "type": "boolean",
            "default": false
          },
          "includePaths": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional path prefixes or regexes to include."
          },
          "excludePaths": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional path prefixes or regexes to skip."
          },
          "collectionId": {
            "type": "string",
            "description": "Optional collection ID to index crawled pages into for search_collection."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "default": "public",
            "description": "Cache and storage visibility (\"private\" isolates crawled pages and indexed collections to the authenticated user)."
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "description": "Result offset when polling an existing crawlId."
          }
        },
        "additionalProperties": false
      },
      "McpTool_SearchInput": {
        "title": "Search Web & News (MCP search)",
        "description": "Searches the web, news headlines (topic=\"news\"), and optional indexed collections, returning ranked results with titles, URLs, snippets, and optional extracted page chunks when includeRawContent is true.",
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Search query, 1-500 characters. Supports site:domain.com (and site:<lang>.wikipedia.org)."
          },
          "maxResults": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20,
            "default": 5,
            "description": "Maximum search results to return (1..20)."
          },
          "timeRange": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month",
              "year"
            ],
            "description": "Optional recency filter."
          },
          "includeDomains": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Restrict results to these domains."
          },
          "excludeDomains": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Exclude results from these domains."
          },
          "includeRawContent": {
            "type": "boolean",
            "default": false,
            "description": "When true, fetches the top result URLs and attaches ranked Markdown chunks."
          },
          "checkPromptInjection": {
            "type": "boolean",
            "default": false,
            "description": "Drop results flagged for prompt injection (they are always flagged)."
          },
          "chunksPerSource": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10,
            "default": 3,
            "description": "Maximum Markdown chunks attached per result when includeRawContent is true."
          },
          "mode": {
            "type": "string",
            "enum": [
              "waterfall",
              "rrf",
              "serper"
            ],
            "description": "rrf: providers in parallel, fused. waterfall: next provider only while results are thin. serper: Serper only."
          },
          "providers": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "serper",
                "brave",
                "searxng",
                "tavily",
                "cloudflare",
                "ceramic"
              ]
            },
            "description": "Optional allowlist of search providers to use."
          },
          "rerank": {
            "type": [
              "boolean",
              "string"
            ],
            "description": "Rerank results: false, true (operator default) or a model such as \"cohere/rerank-5-fast\"."
          },
          "detail": {
            "type": "string",
            "enum": [
              "compact",
              "standard",
              "full"
            ],
            "default": "standard",
            "description": "compact: title, URL, short snippet, score. full: adds score breakdown."
          },
          "collectionId": {
            "type": "string",
            "description": "Optional indexed collection ID to merge into search results."
          },
          "noCache": {
            "type": "boolean",
            "default": false,
            "description": "Set true to bypass cached search results and fetch fresh results."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "default": "public",
            "description": "Cache and search isolation mode (\"private\" isolates search and collection results to the authenticated user)."
          }
        },
        "required": [
          "query"
        ],
        "additionalProperties": true
      },
      "McpTool_SearchCollectionInput": {
        "title": "Search Indexed Collection (MCP search_collection)",
        "description": "Searches pages previously indexed into a collection by scrape, extract, or crawl, returning BM25 relevance-scored chunks (with compact query excerpts on long passages and empty hits when no terms match).",
        "type": "object",
        "properties": {
          "collectionId": {
            "type": "string",
            "default": "default",
            "description": "Target collection ID (e.g. \"default\" or a crawl ID `crw_...`)."
          },
          "query": {
            "type": "string",
            "description": "Keyword query to match against indexed document chunks."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50,
            "default": 10,
            "description": "Maximum matching chunks to return (1..50)."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "default": "public",
            "description": "Index isolation visibility (\"private\" searches the authenticated user private collection)."
          }
        },
        "required": [
          "query"
        ],
        "additionalProperties": false
      },
      "McpTool_InteractInput": {
        "title": "Interact with Page in Sandboxed Headless Browser (MCP interact)",
        "description": "Opens a page in a sandboxed headless browser and executes interactive steps (observe, click, fill, type, press, select, hover, scroll, wait, navigate), returning rendered Markdown, per-action URL/DOM change telemetry, warnings when clicks have no effect, optional screenshots, and a sessionId when keepSession is true.",
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Initial public https:// URL (omit when resuming or closing an existing sessionId)."
          },
          "sessionId": {
            "type": "string",
            "description": "Session token returned from a prior interact call with keepSession=true."
          },
          "keepSession": {
            "type": "boolean",
            "default": false,
            "description": "Keep the isolated browser tab open for follow-up interact calls."
          },
          "closeSession": {
            "type": "boolean",
            "default": false,
            "description": "Close an open browser session after this call."
          },
          "actions": {
            "type": "array",
            "maxItems": 25,
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "observe",
                    "click",
                    "fill",
                    "type",
                    "press",
                    "wait",
                    "scroll",
                    "select",
                    "hover",
                    "navigate"
                  ]
                },
                "selector": {
                  "type": "string"
                },
                "ref": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 300,
                  "description": "Element number from the latest observe action (alternative to selector for click, fill, type, select, press, hover, scroll). Refs expire on navigation; a stale_ref error means call observe again."
                },
                "value": {
                  "type": "string"
                },
                "key": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "waitMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 15000
                }
              },
              "required": [
                "type"
              ],
              "additionalProperties": false
            }
          },
          "formats": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "markdown",
                "html",
                "rawHtml",
                "screenshot",
                "transcript"
              ]
            },
            "default": [
              "markdown"
            ]
          },
          "waitForMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 15000,
            "description": "Milliseconds to wait for page state to settle."
          },
          "waitSelector": {
            "type": "string",
            "description": "Optional CSS selector to wait for before extracting output."
          },
          "maxChars": {
            "type": "integer",
            "minimum": 100,
            "maximum": 500000,
            "description": "Maximum Markdown characters to return in this call (returns totalChars, remainingChars, and nextOffset when truncated)."
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "description": "Character offset into the rendered Markdown for paging large pages."
          },
          "blockTrackers": {
            "type": "boolean",
            "default": true,
            "description": "Abort third-party tracking subresources during headless Chromium renders using the Hub EasyPrivacy host list (default true when loaded; set false to disable for this request only)."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "default": "public",
            "description": "Cache and storage visibility (\"private\" disables shared artifact persistence and isolates responses to the authenticated user)."
          },
          "site": {
            "type": "string",
            "description": "Optional browser-capable worker site ID."
          }
        },
        "additionalProperties": false
      },
      "McpTool_ReadArtifactInput": {
        "title": "Read Paged Crawl Artifact (MCP read_artifact)",
        "description": "Reads a character slice of a stored response artifact by artifactId (either a 64-character hex SHA-256 from fetch_url/fetch_batch/scrape, or an `md:<sha256>` markdownArtifactId from scrape) using offset and limit paging.",
        "type": "object",
        "properties": {
          "artifactId": {
            "type": "string",
            "description": "64-character hex SHA-256 artifact ID (from fetch_url/fetch_batch/scrape) OR `md:<sha256>` (markdownArtifactId from scrape)."
          },
          "format": {
            "type": "string",
            "enum": [
              "raw",
              "markdown"
            ],
            "description": "Optional output format (\"raw\" default for raw artifacts; \"markdown\" reads derived clean Markdown when available)."
          },
          "retention": {
            "type": "string",
            "enum": [
              "transient",
              "stored"
            ],
            "description": "Optional retention tier hint."
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "description": "Character offset to start reading from."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 262144,
            "default": 65536,
            "description": "Maximum characters to return in this page."
          }
        },
        "required": [
          "artifactId"
        ],
        "additionalProperties": false
      },
      "McpTool_JobsInput": {
        "title": "Search & Verify Structured Job Postings (MCP jobs)",
        "description": "Searches official company job boards (Greenhouse, Ashby, Lever, Workday, Workable, Gem, Rippling, SmartRecruiters, company-domain career page discovery, and Built In) or batch-verifies saved job URLs, returning normalized compensation, workplaceType, locations, and posting status.",
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Role or keyword query (e.g. \"Forward Deployed Engineer\", \"Solutions Architect\")."
          },
          "company": {
            "type": "string",
            "description": "Optional company name or job-board organization slug."
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 10,
            "description": "Optional company domains (e.g. [\"cloudflare.com\", \"stripe.com\"]) to probe /careers and /jobs for official job-board discovery."
          },
          "remote": {
            "type": "boolean",
            "description": "When true, keep only remote-eligible roles."
          },
          "locations": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional location substrings to match (e.g. [\"United States\", \"Remote\", \"New York\"])."
          },
          "minBase": {
            "type": "number",
            "minimum": 0,
            "description": "Minimum annual base salary filter."
          },
          "minBaseMode": {
            "type": "string",
            "enum": [
              "floor",
              "ceiling",
              "overlap"
            ],
            "default": "floor",
            "description": "How minBase compares against salary ranges: \"floor\" (pay.min >= minBase) or \"overlap\" / \"ceiling\" (pay.max >= minBase)."
          },
          "strictPay": {
            "type": "boolean",
            "default": false,
            "description": "When true and minBase is set, exclude postings that do not list compensation."
          },
          "postedWithinDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365,
            "description": "Keep postings published within the last N days."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50,
            "default": 20
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "description": "Board pagination offset for paging large job boards (e.g. pass 100 after reading 0..99)."
          },
          "cursor": {
            "type": "string",
            "description": "Pagination cursor returned in nextCursor from a previous truncated jobs response."
          },
          "includeBuiltIn": {
            "type": "boolean",
            "default": true,
            "description": "Include Built In job listings (disabled automatically when company or domains is set)."
          },
          "includePublicFeeds": {
            "type": "boolean",
            "default": false,
            "description": "Opt in to public remote job feeds (We Work Remotely, Himalayas, Working Nomads)."
          },
          "mode": {
            "type": "string",
            "enum": [
              "search",
              "verify"
            ],
            "description": "Execution mode (\"search\" default, or \"verify\" to batch-check whether saved job URLs are still live)."
          },
          "verify": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "description": "Saved https:// job posting URLs to batch-verify (\"live\" | \"closed\" | \"board_gone\" | \"unknown\")."
          },
          "urls": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "description": "Alias for verify when mode=\"verify\"."
          },
          "exclude": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "company": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "description": "Optional list of roles to exclude from results."
          },
          "target": {
            "type": "string",
            "enum": [
              "auto",
              "agent",
              "container"
            ],
            "default": "auto"
          },
          "site": {
            "type": "string",
            "description": "Optional worker site ID when target=\"agent\"."
          }
        },
        "additionalProperties": false
      },
      "McpTool_FindExtractorsInput": {
        "title": "Search Built-In Keyless Site Adapters (MCP find_extractors)",
        "description": "Searches built-in keyless site and public-data adapters (such as SEC EDGAR, arXiv, OpenAlex, ClinicalTrials, openFDA, NIST NVD CVEs, npm, PyPI, Crates, job boards, and Shopify) and returns matching adapter URL patterns and capabilities.",
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Provider name, domain, or data topic (e.g. \"SEC 10-K\", \"CVE\", \"clinical trials\")."
          },
          "category": {
            "type": "string",
            "enum": [
              "jobs",
              "finance",
              "public-records",
              "research-health",
              "developer",
              "genai",
              "commerce-social"
            ]
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50,
            "default": 10
          }
        },
        "required": [
          "query"
        ],
        "additionalProperties": false
      },
      "McpTool_CompanyInput": {
        "title": "Company Profile (Sourced) (MCP company)",
        "description": "Builds a sourced company profile from official and public sources: the company website (schema.org Organization, socials), Wikidata (founded, HQ, industry, employees, ticker), SEC EDGAR (legal name, SIC, latest annual revenue), GitHub, its official ATS job board (open roles, locations), and Google Maps place details when a Google Maps MCP is connected. Every field carries its source.",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Company name (e.g. \"Cloudflare\"). Provide name and/or domain."
          },
          "domain": {
            "type": "string",
            "description": "Company website domain (e.g. \"cloudflare.com\"); strongly recommended for accurate matching."
          },
          "includeHiring": {
            "type": "boolean",
            "default": true,
            "description": "Include the official ATS hiring summary (open roles, locations, sample titles)."
          },
          "includePlaces": {
            "type": "boolean",
            "default": true,
            "description": "Include Google Maps place details when a Google Maps MCP server is connected."
          }
        },
        "additionalProperties": false
      },
      "McpTool_SalariesInput": {
        "title": "Salary Ranges from Employer Postings (MCP salaries)",
        "description": "Aggregates employer-posted pay ranges for a job title from official ATS job postings EdgeFetch has seen (p10/p25/median/p75/p90, by seniority, location, and company, with sample postings). Runs a fresh jobs search when data is thin or refresh=true. Ranges are posted by employers, not self-reported estimates.",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Job title (e.g. \"Senior Software Engineer\", \"Solutions Engineer\")."
          },
          "location": {
            "type": "string",
            "description": "Optional location (\"Remote\", \"United States\", \"New York, NY\", \"London\")."
          },
          "seniority": {
            "type": "string",
            "description": "Optional seniority filter (junior, mid, senior, staff, principal, manager, director, ...)."
          },
          "company": {
            "type": "string",
            "description": "Optional company filter."
          },
          "currency": {
            "type": "string",
            "description": "Optional ISO 4217 currency (defaults to the most common in the matches)."
          },
          "basis": {
            "type": "string",
            "enum": [
              "base",
              "total",
              "ote",
              "all"
            ],
            "description": "Pay basis filter (default: base when enough base ranges exist)."
          },
          "maxAgeDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 730,
            "description": "Only use postings seen within this many days (default 180)."
          },
          "refresh": {
            "type": "boolean",
            "default": false,
            "description": "Run a fresh jobs search first to collect new observations."
          }
        },
        "required": [
          "title"
        ],
        "additionalProperties": false
      },
      "McpTool_CatalogInput": {
        "title": "Extract & Diff Full Storefront Catalog (MCP catalog)",
        "description": "Extracts normalized product, variant, pricing, SKU, and availability records from a public Shopify or WooCommerce storefront (respecting robots.txt and rate limits), or pages and filters an existing catalog snapshot by catalogId.",
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Public https:// storefront or collection URL (omit when paging an existing catalogId)."
          },
          "catalogId": {
            "type": "string",
            "description": "Existing catalog run ID (`cat_...`) to poll status or page/filter product records."
          },
          "platform": {
            "type": "string",
            "enum": [
              "auto",
              "shopify",
              "woocommerce"
            ],
            "default": "auto",
            "description": "Storefront platform (\"auto\" detects Shopify vs WooCommerce)."
          },
          "collection": {
            "type": "string",
            "description": "Optional collection or category slug."
          },
          "fields": {
            "type": "string",
            "enum": [
              "full",
              "lean"
            ],
            "default": "full",
            "description": "\"full\" includes descriptions and images; \"lean\" returns compact pricing, SKU, and availability fields."
          },
          "maxPages": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200,
            "description": "Maximum catalog pages to fetch sequentially."
          },
          "pauseMs": {
            "type": "integer",
            "minimum": 500,
            "maximum": 30000,
            "description": "Polite pause between sequential pages in milliseconds."
          },
          "sync": {
            "type": "boolean",
            "default": true,
            "description": "Set false to run in the background and poll with catalogId."
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "description": "Record offset when paging an existing catalogId."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 250,
            "description": "Maximum records to return when paging an existing catalogId (default 50)."
          },
          "vendor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "description": "Optional vendor/brand filter when paging catalogId records."
          },
          "productType": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "description": "Optional productType filter when paging catalogId records."
          },
          "availableOnly": {
            "type": "boolean",
            "description": "When true, keep only products with at least one in-stock variant."
          },
          "query": {
            "type": "string",
            "description": "Optional keyword filter across title, handle, vendor, tags, and SKUs when paging catalogId."
          },
          "target": {
            "type": "string",
            "enum": [
              "auto",
              "agent",
              "container"
            ],
            "default": "auto"
          },
          "site": {
            "type": "string",
            "description": "Optional worker site ID when target=\"agent\"."
          }
        },
        "additionalProperties": false
      },
      "McpTool_AgentInput": {
        "title": "Autonomous Research & Structured Data Agent (MCP agent)",
        "description": "Runs a multi-step LLM-guided web research and semantic JSON-Schema extraction agent using either a configured server LLM or a caller-supplied BYO-LLM (OpenAI, Anthropic, Gemini, OpenRouter, Ollama, or Workers AI), returning synthesized answers or schema-validated JSON.",
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string",
            "description": "Natural-language research question or extraction goal."
          },
          "agentId": {
            "type": "string",
            "description": "Existing `agt_...` run ID to poll status, fetch trace spans, or cancel."
          },
          "trace": {
            "type": "boolean",
            "default": false,
            "description": "Return execution trace spans when polling agentId."
          },
          "cancel": {
            "type": "boolean",
            "default": false,
            "description": "Cancel a running agentId."
          },
          "urls": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional starting public https:// URLs."
          },
          "strictConstrainToURLs": {
            "type": "boolean",
            "default": false,
            "description": "Restrict navigation strictly to the provided seed urls."
          },
          "schema": {
            "type": "object",
            "description": "Optional JSON Schema for semantic structured output validation."
          },
          "effort": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "default": "medium"
          },
          "maxSteps": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20
          },
          "maxPages": {
            "type": "integer",
            "minimum": 1,
            "maximum": 40
          },
          "threadId": {
            "type": "string",
            "description": "Optional prior `agt_...` threadId for multi-turn follow-up."
          },
          "zeroDataRetention": {
            "type": "boolean",
            "default": false,
            "description": "When true, skips persisting run history or cached artifacts."
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ],
            "default": "public",
            "description": "Run and storage visibility (\"private\" isolates run state, memory, and tool scrapes to the authenticated user)."
          },
          "safe": {
            "type": "boolean",
            "default": false
          },
          "location": {
            "type": "object",
            "properties": {
              "country": {
                "type": "string"
              },
              "languages": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "llm": {
            "type": "object",
            "description": "Optional BYO-LLM configuration (e.g. { provider: \"openai\"|\"anthropic\"|\"gemini\"|\"ollama\", model, baseUrl, apiKey }).",
            "properties": {
              "provider": {
                "type": "string"
              },
              "baseUrl": {
                "type": "string"
              },
              "model": {
                "type": "string"
              },
              "apiKey": {
                "type": "string"
              }
            }
          }
        },
        "additionalProperties": false
      },
      "McpTool_DiscoverMcpsInput": {
        "title": "Discover MCP Servers (Vendor Catalog + Official Registry + Smithery + Glama + PulseMCP) (MCP discover_mcps)",
        "description": "Searches the curated 26 Official Vendor Remote MCP catalog plus Official MCP Registry and community directories (Smithery, Glama, PulseMCP) to find remote and local MCP servers, returning endpoint URLs, authentication requirements, trustTier/untrusted flags, and associated domains.",
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Search keyword, service name, or domain (e.g. \"linear\", \"notion\", \"github\", \"sentry\", \"stripe\", \"strava\")."
          },
          "remoteOnly": {
            "type": "boolean",
            "default": false,
            "description": "When true, return only servers offering remote HTTP or SSE endpoints."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 20,
            "description": "Maximum registry entries to return (1..100)."
          }
        },
        "additionalProperties": false
      },
      "McpTool_QueryMcpInput": {
        "title": "Query Connected Federated MCP Server (MCP query_mcp)",
        "description": "Lists your connected downstream MCP servers, inspects their available tool schemas on demand, or invokes a tool on a connected downstream MCP server.",
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "list_connected",
              "list_tools",
              "call_tool"
            ],
            "default": "list_connected",
            "description": "\"list_connected\" lists connected MCP servers; \"list_tools\" inspects tools on a server; \"call_tool\" executes a tool on a server."
          },
          "server": {
            "type": "string",
            "description": "Connected MCP server id or slug (required for \"list_tools\" and \"call_tool\")."
          },
          "tool": {
            "type": "string",
            "description": "Downstream MCP tool name to execute (required when action=\"call_tool\")."
          },
          "arguments": {
            "type": "object",
            "description": "JSON object arguments passed to the downstream MCP tool when action=\"call_tool\"."
          },
          "allowedMcpTools": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional per-request allow-list of non-read-only cached downstream tools in exact \"<slug>/<tool>\" format."
          },
          "writeConsent": {
            "type": "boolean",
            "description": "Optional per-call write consent flag. Permitted when exact \"<slug>/<tool>\" is in allowedMcpTools unless writeConsent is explicitly false (explicit false vetoes; always blocked for readOnlyOnly vendors like stripe/mapbox)."
          },
          "refresh": {
            "type": "boolean",
            "default": false,
            "description": "When true, bypasses cached tools or private call_tool cache and fetches fresh data from the remote MCP server."
          }
        },
        "additionalProperties": false
      }
    }
  }
}
