web_search for searching the internet and web_fetch for retrieving content from specific URLs.
web_search
Search the web for current information using various search providers.Parameters
Search query string.
Number of results to return (1-10). Defaults to the provider’s configured maximum.
Returns
Formatted search results with titles, URLs, and snippets:
Usage Example
Search Providers
PicoClaw supports multiple search providers with automatic fallback:Provider Priority
- Perplexity (AI-powered search)
- Brave Search (privacy-focused)
- Tavily (AI-optimized search)
- DuckDuckGo (no API key required)
Perplexity Search
AI-powered search using Perplexity’ssonar model.
Configuration:
- LLM-generated search summaries
- Structured result format
- Longer response times (30s timeout)
Brave Search
Direct API access to Brave Search. Configuration:- Privacy-focused
- Fast response times
- Rich result metadata
Tavily Search
Search API optimized for AI applications. Configuration:- Advanced search depth
- AI-optimized results
- Content extraction
DuckDuckGo Search
HTML scraping-based search (no API key required). Configuration:- No API key required
- Privacy-focused
- May be less reliable (HTML parsing)
web_fetch
Fetch content from a URL and extract readable text.Parameters
URL to fetch. Must use
http:// or https:// scheme.Maximum characters to extract. Defaults to 50,000. Minimum 100.
Returns
JSON object containing:
url: The fetched URLstatus: HTTP status codeextractor: Type of content extraction used ("text","json", or"raw")truncated: Boolean indicating if content was truncatedlength: Number of characters in extracted texttext: The extracted content
Usage Example
Content Extraction
HTML to Text
For HTML content,web_fetch extracts readable text:
- Remove
<script>and<style>tags - Remove all HTML tags
- Normalize whitespace
- Clean up blank lines
- Trim and format
JSON Formatting
For JSON content, pretty-prints the response:Raw Content
For other content types, returns raw response body.Security & Limits
URL Validation
- Only
http://andhttps://schemes allowed - Must include a domain
Size Limits
Default limit: 10 MB per request Configure custom limits:Character Truncation
Extracted text is truncated atmaxChars:
Redirect Handling
- Maximum 5 redirects
- Follows redirects automatically
- Returns final URL in response
Timeout
- 60 second timeout per request
- Includes DNS resolution, connection, and transfer time
Proxy Support
Both web tools support HTTP/HTTPS/SOCKS5 proxies:http://https://socks5://socks5h://(DNS resolution through proxy)
Error Handling
web_search Errors
web_fetch Errors
Best Practices
Search Queries
Fetching Content
Result Limits
Error Recovery
- Handle search failures gracefully
- Implement retry logic for transient errors
- Fall back to alternative search terms
- Check HTTP status codes from
web_fetch