🌐 Tool: @fetch
The @fetch tool allows the AI agent to pull specific web pages directly into the context window, bypassing the agent's limited training data bounds and ensuring context perfectly aligns with upstream documentation.
Technical Implementation
Implemented in crates/agent/src/tools/fetch_tool.rs, the tool utilizes a headless Chromium instance (via the Chromiumoxide library).
Unlike standard HTTP libraries, @fetch ensures:
- Client-Side Rendering: Executes JavaScript (React, Vue, etc.) to capture content on modern single-page applications.
- Markdown Transformation: Automatically converts the resulting DOM into clean, hierarchical Markdown.
Usage Examples
Example 1: Updating out-of-date library syntax
Example 2: Reading API Specifications
Key Advantages & Impact
- Dynamic Context: Allows the agent to use libraries that were released after its knowledge cutoff.
- Accurate Syntax: By reading the official docs, the agent avoids deprecated API patterns and solves "it works on my machine" issues.
- Privacy: All rendering happens within a local Chromium process; no third-party scraping services are used.
- Bypass Paywalls/Restrictions: Handles complex login-less modern docs that simple
curl-based scrapers can't see.