@@ -211,15 +211,15 @@ async def web_search(
211211
212212@mcp_server .tool
213213async def web_read (
214- urls : str | list [str ],
214+ url_list : list [str ],
215215 timeout : int = 30 ,
216216 locale : str = "en-US" ,
217217 max_concurrent : int = 5 ,
218218) -> Dict [str , Any ]:
219219 """Read and extract content from web pages.
220220
221221 Args:
222- urls: URL (string) or list of URLs to read content from
222+ url_list: List of URLs to read content from (for single URL, use array with one element)
223223 timeout: Request timeout in seconds (default: 30)
224224 locale: Browser locale (default: en-US)
225225 max_concurrent: Maximum concurrent requests for multiple URLs (default: 5)
@@ -233,9 +233,13 @@ async def web_read(
233233 try :
234234 api_key = get_api_key ()
235235
236- # Build read request
236+ # Validate url_list parameter
237+ if not url_list or len (url_list ) == 0 :
238+ return {"error" : "url_list parameter is required and must contain at least one URL" }
239+
240+ # Build read request using the correct WebReadRequest model
237241 read_data = {
238- "urls " : urls ,
242+ "url_list " : url_list ,
239243 "timeout" : timeout ,
240244 "locale" : locale ,
241245 "max_concurrent" : max_concurrent ,
@@ -373,15 +377,15 @@ async def aperag_usage_guide() -> str:
373377
374378### Web Content Reading Example:
375379```
376- # Read content from web pages
380+ # Read content from web pages (single URL - use array with one element)
377381content = web_read(
378- urls= "https://example.com/article", # single URL
382+ url_list=[ "https://example.com/article"] , # single URL in array
379383 timeout=30
380384)
381385
382- # Or read from multiple URLs
386+ # Read from multiple URLs
383387content = web_read(
384- urls =["https://example.com/page1", "https://example.com/page2"], # multiple URLs
388+ url_list =["https://example.com/page1", "https://example.com/page2"], # multiple URLs
385389 max_concurrent=2
386390)
387391
@@ -407,7 +411,7 @@ async def aperag_usage_guide() -> str:
407411urls = [result.url for result in web_results.results]
408412
409413# 3. Read full content from those pages
410- web_content = web_read(urls =urls, max_concurrent=2)
414+ web_content = web_read(url_list =urls, max_concurrent=2)
411415
412416# 4. Search your internal knowledge base for related information
413417collections = list_collections()
0 commit comments