url_context (Gemini)
Tool : A precise action the AI can call · requires gemini-api
Reads the content of URLs you pass in the prompt.
Google's web_fetch; same vigilance regarding injection.
Security reflects where data goes, requested permissions and incidents on record at the verification date. It is not a guarantee of zero risk: check the deployment mode and the connections you enable.
What it does, concretely
When working with the Gemini API, analysing web content without manually copying entire pages is a common need. The url_context tool addresses this by allowing the model to directly fetch and read the content of web pages from URLs provided in the prompt.
In practice, the tool works in two stages: it first looks for content in an internal indexed cache for speed, then falls back to a live fetch if the page is not yet indexed. The model can process up to 20 URLs per request, each up to 34 MB, and it cites its sources through inline annotations in the response.
This tool is aimed at developers building applications that require data extraction, document comparison, multi-source summarisation, or analysis of code repositories and technical documentation. It can also be combined with Google Search to first find relevant pages and then analyse them in depth.
However, it is not suited for use cases requiring access to pages behind a login or paywall, YouTube videos, Google Workspace files, or resources on private or local networks. It is limited to the Gemini API and is not available on the Gemini Enterprise Agent Platform.
What it offers
- ·Reading the content of public web pages from URLs provided directly in the prompt.
- ·Processing up to 20 URLs per request, with a maximum content size of 34 MB per URL.
- ·Two-stage retrieval: internal indexed cache first, then live fetch if the page is not yet indexed.
- ·Inline citation annotations in the response, linking each passage back to its source URL.
- ·Can be combined with Google Search to first find relevant pages and then analyse them in depth.
- ·Can be combined with custom tools via function calling on Gemini 3 models.
- ·Support for various formats: HTML, PDF, JSON, CSV, PNG and JPEG images, among others.
- ·Automatic safety check on each URL before processing, with status returned in the response.
In practice
- Price
- Freemium
- Commercial use
- Commercial use: yes
- Available on
- api
- Host
- gemini-api
- FR interface
- No
Security and data
- Rating
- Security: one caveat, see the card
- Capabilities
- readswritesexecutesnetwork
- Your data
- Data with the vendor
- Maintenance
- Active
Links and repository checked on 25 October 2026 · added on 1 May 2025
How to install url_context (Gemini)
pip install google-genai