web_search
Search the web for current information using Brave Search or DuckDuckGo.Input Parameters
Search query string
Number of results to return (1-10)
Response
Returns formatted search results with titles, URLs, and snippets.Formatted search results:
Usage Example
Search Providers
Brave Search (recommended):- Requires API key configuration
- Higher quality results with structured data
- Rate limits apply based on plan
- No API key required
- HTML scraping-based extraction
- May have less consistent formatting
Provider Selection
Priority: Brave Search > DuckDuckGoError Conditions
query is required- Missing query parametersearch failed: {error}- Network error or provider failure- Returns
niltool if no provider is enabled or configured
web_fetch
Fetch a URL and extract readable content (HTML to text conversion).Input Parameters
URL to fetch. Must be
http:// or https://Maximum characters to extract (minimum: 100)
Response
Returns extracted content with metadata.The fetched URL
HTTP status code (e.g., 200, 404)
Content extraction method used:
text- HTML converted to plain textjson- JSON formatted responseraw- Raw content returned as-is
Whether content was truncated to maxChars limit
Length of returned content in characters
Extracted content
Usage Examples
Fetch HTML page:Content Extraction
HTML Extraction (text):
- Remove
<script>and<style>tags and contents - Strip all HTML tags
- Normalize whitespace (multiple spaces → single space)
- Remove empty lines
- Return clean text content
- Parses JSON response
- Pretty-prints with 2-space indentation
- Returns formatted JSON string
- Returns content as-is for non-HTML, non-JSON types
LLM vs User Output
ForLLM (summary):Error Conditions
Validation errors:url is required- Missing URL parameterinvalid URL- Malformed URL syntaxonly http/https URLs are allowed- Unsupported scheme (e.g., ftp://)missing domain in URL- URL has no hostname
failed to create request- Request setup failedrequest failed- Network timeout or connection errorstopped after 5 redirects- Too many redirectsfailed to read response- Response body read error
HTTP Client Configuration
- Timeout: 60 seconds
- Max redirects: 5
- Idle connections: 10
- TLS handshake timeout: 15 seconds
- User-Agent: Chrome 120 desktop browser
Security Considerations
URL Validation
- Only
http://andhttps://schemes allowed - Must have valid hostname/domain
- URL parsing validates syntax before request
Content Safety
- No JavaScript execution (HTML extraction strips
<script>tags) - Maximum content limits prevent memory exhaustion
- Timeout protection prevents hanging requests
- Redirect limits prevent infinite loops
Privacy
- Uses standard browser User-Agent for compatibility
- No cookies or session persistence
- Each request is independent