crewAIInc/crewAI · error · ValueError

Website URL must be provided either during initialization or

Error message

Website URL must be provided either during initialization or execution

What it means

JinaScrapeWebsiteTool can receive a website_url either at construction time or per _run() call; this ValueError fires when neither is supplied. The tool resolves url = website_url or self.website_url and refuses to proceed with an empty value, since the Jina reader endpoint (https://r.jina.ai/<url>) requires a target.

Source

Thrown at lib/crewai-tools/src/crewai_tools/tools/jina_scrape_website_tool/jina_scrape_website_tool.py:46

        custom_headers: dict[str, str] | None = None,
        **kwargs: Any,
    ):
        super().__init__(**kwargs)
        if website_url is not None:
            self.website_url = website_url
            self.description = f"A tool that can be used to read {website_url}'s content and return markdown content."
            self._generate_description()

        if custom_headers is not None:
            self.headers = custom_headers

        if api_key is not None:
            self.headers["Authorization"] = f"Bearer {api_key}"

    def _run(self, website_url: str | None = None) -> str:
        url = website_url or self.website_url
        if not url:
            raise ValueError(
                "Website URL must be provided either during initialization or execution"
            )

        url = validate_url(url)
        response = requests.get(
            f"https://r.jina.ai/{url}", headers=self.headers, timeout=15
        )
        response.raise_for_status()
        return response.text

View on GitHub (pinned to 754d7323be)

Solutions

  1. Pass the URL at initialization: JinaScrapeWebsiteTool(website_url="https://example.com")
  2. Or pass it per call: tool._run(website_url="https://example.com") / include it in the tool input JSON
  3. If an agent should supply it, verify the tool's args_schema exposes website_url and the task description instructs the agent to include it

Example fix

# before
tool = JinaScrapeWebsiteTool()  # no URL
tool.run()  # ValueError

# after
tool = JinaScrapeWebsiteTool(website_url="https://example.com")
result = tool.run()
Defensive patterns

Strategy: validation

Validate before calling

def ensure_url(tool) -> str:
    url = tool.website_url  # may be None
    if not url:
        raise ValueError("Provide website_url to JinaScrapeWebsiteTool(...) or to run()")
    return url

Try / catch

try:
    out = tool.run()
except ValueError as e:
    if "Website URL" in str(e):
        out = tool.run(website_url="https://example.com")
    else:
        raise

Prevention

When it happens

Trigger: Constructing JinaScrapeWebsiteTool() with no website_url and then calling tool.run() / _run() with no argument; passing website_url=None or an empty string explicitly; instantiating via CrewAI with an agent that omits the URL argument.

Common situations: Copying example code that relied on an older constructor signature; relying on the LLM to fill the parameter but the tool schema not exposing it; passing the URL in the wrong parameter name.

Related errors


AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15). Data as JSON: /api/errors/8907dbc42647e160. Report an issue: GitHub.