MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / web_fetch_urls

Function web_fetch_urls

src/sandbox_vm/tools/web/utils.py:52–80  ·  view source on GitHub ↗

Download multiple URLs and return sandbox handles to the saved artifacts. Args: urls (required): list of urls Returns: { results: [{ url, handle }] }

(ctx: Context, urls: List[str])

Source from the content-addressed store, hash-verified

50
51
52async def web_fetch_urls(ctx: Context, urls: List[str]) -> dict:
53 """
54 Download multiple URLs and return sandbox handles to the saved artifacts.
55
56 Args:
57 urls (required): list of urls
58
59 Returns:
60 {
61 results: [{ url, handle }]
62 }
63 """
64 sid = _sid(ctx)
65 results: List[Dict[str, Any]] = []
66
67 for url in urls:
68 try:
69 nav = await browser_navigate(ctx, url)
70 if not nav or "error" in nav:
71 continue
72
73 saved = await _save_current_page_html(ctx, nav.get("url") or url)
74 if "error" not in saved:
75 results.append({"url": url, "handle": saved["handle"]})
76 except Exception:
77 continue
78
79 MANAGER.touch(sid)
80 return _ok(results=results)
81
82
83async def web_fetch_and_parse_urls(

Callers 1

web_fetch_and_parse_urlsFunction · 0.85

Calls 6

_sidFunction · 0.90
browser_navigateFunction · 0.90
_okFunction · 0.90
_save_current_page_htmlFunction · 0.85
getMethod · 0.80
touchMethod · 0.45

Tested by

no test coverage detected