Repository navigation
feat(tools): add web_fetch built-in - #373
Merged
Merged
Conversation
Fetches http(s) URLs and returns readable text (HTML tags/scripts/styles stripped). Always registered, unlike web_search, since it needs no provider/API key. Guards against SSRF by refusing non-http(s) schemes and loopback/private/link-local targets, both for literal IPs and via DNS resolution, with the same check re-applied on each redirect hop.
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
Fetches http(s) URLs and returns readable text (HTML tags/scripts/styles stripped). Always registered, unlike web_search, since it needs no provider/API key. Guards against SSRF by refusing non-http(s) schemes and loopback/private/link-local targets, both for literal IPs and via DNS resolution, with the same check re-applied on each redirect hop.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
Fetches http(s) URLs and returns readable text (HTML tags/scripts/styles stripped). Always registered, unlike web_search, since it needs no provider/API key. Guards against SSRF by refusing non-http(s) schemes and loopback/private/link-local targets, both for literal IPs and via DNS resolution, with the same check re-applied on each redirect hop.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
Fetches http(s) URLs and returns readable text (HTML tags/scripts/styles stripped). Always registered, unlike web_search, since it needs no provider/API key. Guards against SSRF by refusing non-http(s) schemes and loopback/private/link-local targets, both for literal IPs and via DNS resolution, with the same check re-applied on each redirect hop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
web_fetchbuilt-in tool that fetches anhttp(s)URL and returns its content as plain text, stripping HTML tags/scripts/styles.web_search, which needs a configured provider/API key) — it's a direct HTTP GET.Test plan
cargo test -p forge-tools— new unit tests for the SSRF guard, HTML-to-text conversion, and a local raw-TCP integration test for fetch/render (green)cargo test --workspace— green (one unrelated pre-existing perf-timing flake inforge-tui, confirmed passes in isolation)cargo fmt --all -- --check— cleancargo clippy --workspace --all-targets— clean