Skip to main content
The web search tool enables agents to search the internet and retrieve information.

Overview

The web search tool provides:
  • Multiple search engine backends
  • Result aggregation and ranking
  • Web page content extraction
  • Rate limiting and caching

Parameters

string
required
Search query string
integer
Number of results to return (default: 5, max: 10)
boolean
Whether to fetch full page content (default: false)

Example

Response

array
Array of search results

Example Response

Search Backends

Privacy-focused search with no API key required.Features:
  • No tracking
  • No API key needed
  • Good for general queries
  • Rate limited

Configuration

Rate Limiting

To avoid overwhelming search engines:
  • DuckDuckGo: 1 request per second
  • Google: 100 queries per day (free tier)
  • Brave: 2000 queries per month (free tier)
Results are cached for 1 hour by default.

Content Extraction

When fetch_content=true, the tool:
  1. Fetches the full HTML page
  2. Extracts main content (removes ads, navigation)
  3. Converts HTML to plain text or markdown
  4. Truncates to 10,000 characters
Fetching content significantly increases response time and may trigger rate limits.

Security

  • HTTPS enforcement
  • Domain allowlist (optional)
  • Content size limits
  • Request timeouts
  • XSS prevention in extracted content

Examples

The agent will use web_search tool automatically.

Fetch Full Content

Source Code

Implementation: src/tools/web_search.rs