{"record":{"id":"8907dbc42647e160","repo":"crewAIInc/crewAI","slug":"website-url-must-be-provided-either-during-initial","errorCode":null,"errorMessage":"Website URL must be provided either during initialization or execution","messagePattern":"Website URL must be provided either during initialization or execution","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/jina_scrape_website_tool/jina_scrape_website_tool.py","lineNumber":46,"sourceCode":"        custom_headers: dict[str, str] | None = None,\n        **kwargs: Any,\n    ):\n        super().__init__(**kwargs)\n        if website_url is not None:\n            self.website_url = website_url\n            self.description = f\"A tool that can be used to read {website_url}'s content and return markdown content.\"\n            self._generate_description()\n\n        if custom_headers is not None:\n            self.headers = custom_headers\n\n        if api_key is not None:\n            self.headers[\"Authorization\"] = f\"Bearer {api_key}\"\n\n    def _run(self, website_url: str | None = None) -> str:\n        url = website_url or self.website_url\n        if not url:\n            raise ValueError(\n                \"Website URL must be provided either during initialization or execution\"\n            )\n\n        url = validate_url(url)\n        response = requests.get(\n            f\"https://r.jina.ai/{url}\", headers=self.headers, timeout=15\n        )\n        response.raise_for_status()\n        return response.text\n","sourceCodeStart":28,"sourceCodeEnd":56,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/jina_scrape_website_tool/jina_scrape_website_tool.py#L28-L56","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Pass the URL at initialization: JinaScrapeWebsiteTool(website_url=\"https://example.com\")","Or pass it per call: tool._run(website_url=\"https://example.com\") / include it in the tool input JSON","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"],"exampleFix":"# before\ntool = JinaScrapeWebsiteTool()  # no URL\ntool.run()  # ValueError\n\n# after\ntool = JinaScrapeWebsiteTool(website_url=\"https://example.com\")\nresult = tool.run()","handlingStrategy":"validation","validationCode":"def ensure_url(tool) -> str:\n    url = tool.website_url  # may be None\n    if not url:\n        raise ValueError(\"Provide website_url to JinaScrapeWebsiteTool(...) or to run()\")\n    return url","typeGuard":null,"tryCatchPattern":"try:\n    out = tool.run()\nexcept ValueError as e:\n    if \"Website URL\" in str(e):\n        out = tool.run(website_url=\"https://example.com\")\n    else:\n        raise","preventionTips":["Always pass website_url at construction unless an agent supplies it per call","In agent tasks, explicitly instruct the agent to include the URL argument","Validate required tool inputs in a pre-flight check before starting the crew"],"tags":["validation","jina","crewai-tools","required-argument"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}