Is your feature request related to a specific problem?
The load_web_page() function in src/google/adk/tools/load_web_page.py calls requests.get() without a timeout parameter. If the target server is unresponsive, the agent hangs indefinitely with no way to recover. Additionally, the function accepts any URL scheme (file://, ftp://, etc.) and does not handle Timeout or ConnectionError exceptions, causing uncontrolled errors to propagate.
Describe the Solution You'd Like
- Add
timeout=10 to requests.get() to prevent indefinite hangs
- Validate that the URL scheme is
http or https before making the request
- Handle
requests.exceptions.Timeout and requests.exceptions.ConnectionError, returning descriptive error messages
Impact on your work
When building agents that use load_web_page as a tool, an unresponsive URL blocks the entire agent execution. This makes production deployments unreliable.
Willingness to contribute
Yes. I will submit a PR with the implementation and unit tests shortly.
Describe Alternatives You've Considered
Wrapping the tool call in a try/except at the agent level, but this pushes error handling to every consumer instead of solving it at the source.
Proposed API / Implementation
N/A - No API changes, only internal hardening. The function signature remains load_web_page(url: str) -> str.
Additional Context
The function already has SSRF protection via allow_redirects=False. These changes complement that existing hardening. The PR includes 11 unit tests covering all new behavior.