Skip to content

Add web fetch tool#36

Merged
amrit110 merged 5 commits intomainfrom
ak/add_web_fetch_tool
Feb 5, 2026
Merged

Add web fetch tool#36
amrit110 merged 5 commits intomainfrom
ak/add_web_fetch_tool

Conversation

@amrit110
Copy link
Member

@amrit110 amrit110 commented Feb 4, 2026

Summary

This PR adds a new tool to the tools package. The tool is for fetching web content (HTML pages and PDFs given a URL)

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test improvements
  • 🔒 Security fix

Changes Made

  • Add web fetch tool (fetches HTML content and PDFs)
  • Add unit tests

Testing

  • Tests pass locally (uv run pytest tests/)
  • Type checking passes (uv run mypy <src_dir>)
  • Linting passes (uv run ruff check src_dir/)
  • Manual testing performed (describe below)

Manual testing details:
Tested with Agent that can call this tool

Screenshots/Recordings

NA

Related Issues

NA

Deployment Notes

Checklist

  • Code follows the project's style guidelines
  • Self-review of code completed
  • Documentation updated (if applicable)
  • No sensitive information (API keys, credentials) exposed

@amrit110 amrit110 marked this pull request as ready for review February 4, 2026 22:14
@amrit110 amrit110 self-assigned this Feb 4, 2026
@amrit110 amrit110 added the enhancement New feature or request label Feb 4, 2026
@amrit110 amrit110 requested review from fcogidi and lotif February 4, 2026 22:14

def create_web_fetch_tool() -> FunctionTool:
"""Create an ADK FunctionTool for fetching web content."""
return FunctionTool(func=web_fetch)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do you use this function? I can only see it being used on a test.

Copy link
Member Author

@amrit110 amrit110 Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yet to add my updated agent implementation that uses. Thought I'd keep my PRs small so they are easier to review.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That being said, it looks a little overkill to have that single line in a function. I'd just do FunctionTool(func=web_fetch) on the callers instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah agree, but i thought its nice to have these explicit constructor methods, when i finally have this as a usable package.

@amrit110 amrit110 requested a review from lotif February 5, 2026 20:38
Copy link
Collaborator

@lotif lotif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with one minor optional comment.

@amrit110 amrit110 merged commit 31164e1 into main Feb 5, 2026
3 checks passed
@amrit110 amrit110 deleted the ak/add_web_fetch_tool branch February 5, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants