Code Engineering
Fetch a URL and return its text body with HTML stripped to plaintext.
web_fetchDistinct from web_scrape (HTML-structured scraping) and web_search (search-engine queries). web_fetch is the read-the-page-as-text verb a coding agent uses to enrich its understanding from external docs.
Java HttpClient with normal redirect-following and a 10s connect timeout. Strips <script> and <style> blocks before tag-stripping; collapses runs of blank lines.
When a user asks:
What does the README of the spring-ai repo say about prompt caching?
the agent calls the tool:
web_fetch(url="https://raw.githubusercontent.com/spring-projects/spring-ai/main/README.md")and gets back: Spring AI — README ... ## Prompt caching Spring AI exposes a CachingChatClient that wraps any provider... ...
Real scenarios where agents put this tool to work.
Implementation lives at swarmai-tools/src/main/java/ai/intelliswarm/swarmai/tool/code/web/WebFetchTool.java in the swarm-ai repository.