|
Download docs/tools/web-fetch.md from SaylorTwift/gemini-cli: direct link, hf CLI and curl.
- Browser
- Download file 1.68 kB
-
https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/docs/tools/web-fetch.md
- Command line
-
hf download hf://SaylorTwift/gemini-cli/docs/tools/web-fetch.md
-
curl -L -o web-fetch.md https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/docs/tools/web-fetch.md
1.68 kB
| # Web fetch tool (`web_fetch`) | |
| The `web_fetch` tool allows the Gemini agent to retrieve and process content | |
| from specific URLs provided in your prompt. | |
| ## Technical reference | |
| The agent uses this tool when you include URLs in your prompt and request | |
| specific operations like summarization or extraction. | |
| ### Arguments | |
| - `prompt` (string, required): A request containing up to 20 valid URLs | |
| (starting with `http://` or `https://`) and instructions on how to process | |
| them. | |
| ## Technical behavior | |
| - **Network access:** Destination URLs and resolved IP addresses are validated | |
| to restrict access to private, reserved, loopback, and internal networks | |
| (e.g., RFC 1918 addresses and internal domains). Transport connections are | |
| pinned to the resolved destination IP address. | |
| - **Confirmation:** Triggers a confirmation dialog showing the converted URLs. | |
| - **Plan Mode:** In [Plan Mode](../cli/plan-mode.md), `web_fetch` is available | |
| but always requires explicit user confirmation (`ask_user`). | |
| - **Processing:** Uses the Gemini API's `urlContext` for retrieval. | |
| - **Fallback:** If API access fails, the tool attempts to fetch raw content | |
| directly from your local machine (with destination IP validation and | |
| connection pinning applied). | |
| - **Formatting:** Returns a synthesized response with source attribution. | |
| ## Use cases | |
| - Summarizing technical articles or blog posts. | |
| - Comparing data between two or more web pages. | |
| - Extracting specific information from a documentation site. | |
| ## Next steps | |
| - Follow the [Web tools guide](../cli/tutorials/web-tools.md) for practical | |
| usage examples. | |
| - See the [Web search tool reference](./web-search.md) for general queries. | |