MCPcopy Create free account
hub / github.com/ScrapeGraphAI/scrapecraft / add_url

Function add_url

backend/app/agents/tools.py:18–36  ·  view source on GitHub ↗

Add a URL to the scraping pipeline.

(url: str)

Source from the content-addressed store, hash-verified

16
17@tool
18def add_url(url: str) -> Dict[str, Any]:
19 """Add a URL to the scraping pipeline."""
20 # Validate URL format
21 try:
22 result = urlparse(url)
23 if not all([result.scheme, result.netloc]):
24 return {"success": False, "error": "Invalid URL format"}
25
26 # Check if URL starts with http/https
27 if result.scheme not in ['http', 'https']:
28 return {"success": False, "error": "URL must start with http:// or https://"}
29
30 return {
31 "success": True,
32 "url": url,
33 "message": f"Successfully added {url} to the pipeline"
34 }
35 except Exception as e:
36 return {"success": False, "error": str(e)}
37
38@tool
39def remove_url(url: str) -> Dict[str, Any]:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected