Skip to main content

Web tools

Web tools are used for web search and fetching. They are two tools with separate switches:

  • web_search is enabled by tools.web.enabled (default true).
  • web_fetch is enabled by tools.web_fetch.enabled (default true).

Provider settings and fetch settings live under tools.web.*.

Provider selection​

ConfigTypeDefaultDescription
providerstringautoSearch provider to use: auto, brave, duckduckgo, gemini, glm_search, baidu_search, kagi, keenable, perplexity, searxng, sogou, or tavily. Unknown values fall back to auto
prefer_nativebooltruePrefer the active LLM's built-in web search (for example OpenAI's native search) over the configured search engines. The client-side web_search tool is hidden while native search is available, and PicoClaw falls back to it automatically

With auto, PicoClaw picks the first ready provider (enabled and fully configured for its type). Order: perplexity, brave, kagi, searxng, tavily, gemini, keenable; then sogou/duckduckgo (choosing between the two based on the query when both are ready); finally baidu_search and glm_search. Sogou, DuckDuckGo, and Keenable work without a key; SearXNG needs a base_url; the other providers need an API key. A ready provider configured explicitly in provider wins over the order.

Web Fetcher​

General settings for fetching and processing webpage content.

ConfigTypeDefaultDescription
tools.web_fetch.enabledbooltrueRegister the web_fetch tool to fetch and process webpage content
tools.web.fetch_limit_bytesint10485760Maximum size of the webpage payload to fetch, in bytes (default is 10MB).
tools.web.formatstring"plaintext"Output format of the fetched content. Options: plaintext or markdown (recommended).
tools.web.proxystring""Optional proxy URL for web tools (http, https, socks5, socks5h). For authenticated proxies, prefer the HTTP_PROXY/HTTPS_PROXY environment variables instead of embedding credentials in config

Pages that need a real browser​

web_fetch is an HTTP client, not a browser: it does not execute JavaScript, keep cookies or a login session, or interact with the page. When a site returns only a JavaScript shell, a 403/429, a cookie or consent wall, or content that appears after client-side rendering, use browser automation instead. Playwright MCP drives a real Chromium browser with the same agent, while web_fetch remains the cheaper default for static pages and structured endpoints.

web_fetch already retries one Cloudflare cf-mitigated: challenge response with an honest PicoClaw user agent, but it cannot execute the challenge page. If the retry still returns a challenge or a 403/429, the browser is the next step.

A real browser also helps with sites that treat non-browser clients differently, but it is not a CAPTCHA solver or a guarantee against bot detection. See Anti-bot reality.

Brave​

ConfigTypeDefaultDescription
enabledboolfalseEnable Brave search
api_keystring-Brave Search API key
api_keysstring[]-Multiple API keys for rotation (takes priority over api_key)
max_resultsint5Maximum number of results

DuckDuckGo​

ConfigTypeDefaultDescription
enabledboolfalseEnable DuckDuckGo search
max_resultsint5Maximum number of results

Sogou​

ConfigTypeDefaultDescription
enabledbooltrueEnable Sogou search
max_resultsint5Maximum number of results

Sogou and DuckDuckGo are keyless engines; when both are ready, auto picks between them based on the query language.

Gemini search uses Gemini with Google Search grounding. It returns an AI-synthesized answer with citations from Google Search.

ConfigTypeDefaultDescription
enabledboolfalseEnable Gemini Google Search
api_keystring-Google Gemini API key
modelstringgemini-2.5-flashGemini model used for search
max_resultsint5Maximum number of citations
{
"tools": {
"web": {
"gemini": {
"enabled": true,
"api_key": "YOUR_GEMINI_API_KEY",
"model": "gemini-2.5-flash",
"max_results": 5
}
}
}
}

Baidu Search uses the Qianfan AI Search API, which is AI-powered and optimized for Chinese-language queries.

ConfigTypeDefaultDescription
enabledboolfalseEnable Baidu Search
api_keystring-Qianfan API key
base_urlstringhttps://qianfan.baidubce.com/v2/ai_search/web_searchBaidu Search API URL
max_resultsint5Maximum number of results
{
"tools": {
"web": {
"baidu_search": {
"enabled": true,
"api_key": "YOUR_BAIDU_QIANFAN_API_KEY",
"max_results": 10
}
}
}
}

Perplexity​

ConfigTypeDefaultDescription
enabledboolfalseEnable Perplexity search
api_keystring-Perplexity API key
api_keysstring[]-Multiple API keys for rotation (takes priority over api_key)
max_resultsint5Maximum number of results

Kagi Search uses the official Kagi OpenAPI client for POST /search and returns normal web results from data.search.

ConfigTypeDefaultDescription
enabledboolfalseEnable Kagi Search
api_keystring-Kagi API key
api_keysstring[]-Multiple API keys for rotation (takes priority over api_key)
base_urlstringhttps://kagi.com/api/v1/searchKagi Search API endpoint
max_resultsint5Maximum number of results
{
"tools": {
"web": {
"provider": "kagi",
"kagi": {
"enabled": true,
"max_results": 5,
"base_url": "https://kagi.com/api/v1/search"
}
}
}
}

Store Kagi API keys in .security.yml:

web:
kagi:
api_keys:
- "YOUR_KAGI_API_KEY"

Kagi API usage may be billed or limited separately from a normal Kagi subscription, depending on your account and API setup.

Keenable​

Keenable works without an API key. With no key configured, requests go to the public endpoint (POST /v1/search/public), which is rate limited per IP (10 requests/second, 1000 per hour). Setting a key switches to POST /v1/search and lifts those limits; nothing else changes.

ConfigTypeDefaultDescription
enabledboolfalseEnable Keenable search
api_keysstring[]-Optional API keys; rotated like other providers
base_urlstringhttps://api.keenable.aiKeenable API base URL
max_resultsint5Maximum number of results
{
"tools": {
"web": {
"provider": "keenable",
"keenable": {
"enabled": true,
"max_results": 5
}
}
}
}

To lift the keyless rate limits, store a key in .security.yml:

web:
keenable:
api_keys:
- "YOUR_KEENABLE_API_KEY"

The range parameter maps to published_after (d, w, m, y become a date 1 day, 7 days, 1 month, or 1 year before today).

Tavily​

ConfigTypeDefaultDescription
enabledboolfalseEnable Tavily search
api_keystring-Tavily API key
base_urlstring-Custom Tavily API base URL
max_resultsint5Maximum number of results

SearXNG​

ConfigTypeDefaultDescription
enabledboolfalseEnable SearXNG search
base_urlstringhttp://localhost:8888SearXNG instance URL
max_resultsint5Maximum number of results
ConfigTypeDefaultDescription
enabledboolfalseEnable GLM Search
api_keystring-GLM API key
base_urlstringhttps://open.bigmodel.cn/api/paas/v4/web_searchGLM Search API URL
search_enginestringsearch_stdSearch engine type
max_resultsint5Maximum number of results

Additional Web Settings​

ConfigTypeDefaultDescription
private_host_whiteliststring[][]Private/internal hosts allowed for web fetching

web_search Tool Parameters​

At runtime, the web_search tool accepts the following parameters:

FieldTypeRequiredDescription
querystringyesSearch query string
countintegernoNumber of results to return. Default: 10, max: 10
rangestringnoOptional time filter: d (day), w (week), m (month), y (year)

If range is omitted, PicoClaw performs an unrestricted search. For Kagi, d, w, and m map to Kagi lens time_relative; y maps to a lens time_after date one year before the current day.

Search results are normalized before they are returned: runs of blank lines in provider snippets are collapsed to a single newline, so repeated hard wraps cannot bloat the result layout or its large-result artifact. Single line breaks, tabs, indentation, and markdown structure are preserved.

Example web_search Call​

{
"query": "ai agent news",
"count": 10,
"range": "w"
}

web_fetch Tool Parameters​

FieldTypeRequiredDescription
urlstringyesURL to fetch
maxCharsintegernoMaximum characters to extract (minimum 1500). Defaults to tools.max_inline_result_chars; a smaller value returns a shorter inline preview while the full page is still saved as an artifact.

maxChars defaults to the same tools.max_inline_result_chars budget used by the spill layer, so pages that fit stay inline. A per-call value may only lower that budget, which is useful when the model needs less context; values below the 1500 minimum are raised to it, unless the configured budget is already lower. The tool's requested preview stays inline as long as it fits the inline budget, and the full pre-truncation page is still saved as an artifact, even when the page is smaller than max_inline_result_chars.

A truncated preview is never the only copy. When maxChars cuts the page, the full pre-truncation text is saved as a workspace artifact and the result is front-loaded with a warning telling the model to read the artifact before answering. The artifact is capped server-side at 2,000,000 characters regardless of the requested preview size. If the page exceeds that cap, the artifact keeps a head+tail window with an [ARTIFACT TRUNCATED - N chars omitted out of T total] notice and the warning says the stored copy was truncated and points to a structured endpoint or a narrower source. This makes the benchmark failure mode — answering from a 1,500-character preview while the missing fact sat in the omitted page — explicit and recoverable.

When an intact web_fetch envelope is spilled to a workspace artifact (<workspace>/.artifacts/tool/), it is stored as its pageable text: the extracted content with real newlines, followed by a <web-fetch-metadata> block holding the other result fields (URL, status, extractor, truncation flag, length). This keeps the artifact usable with read_file (offset/length) and search_files. A payload is recognized only when it carries the full envelope shape (only known keys, a non-empty url, a numeric status, and a non-empty text); unrecognized JSON from other tools is stored verbatim. When maxChars did truncate the page, the artifact stores the full pre-truncation page text instead (up to the 2,000,000-character cap, see above).

Example web_fetch Call​

{
"url": "https://go.dev/doc/devel/release",
"maxChars": 12000
}

For "latest version" questions, prefer a structured endpoint when the source offers one instead of scraping a long release page. For example, https://go.dev/VERSION?m=text returns the current Go version in one line. This is cheaper, avoids truncation entirely, and removes the risk of anchoring on the first version listed in a page.

Payment-required resources (HTTP 402)​

web_fetch does not treat 402 Payment Required as an opaque HTTP failure. When the server returns an x402 payment challenge, PicoClaw parses it and exposes the payment details to both the model and the user:

  • x402 v2: base64-encoded JSON in the PAYMENT-REQUIRED response header.
  • x402 v1: JSON in the 402 response body, used as a fallback when the header is absent or malformed.

The result is a structured JSON object with url, status (402), an optional payment_required object, payment_details_error when a challenge was present but could not be decoded, a bounded body snippet, and a message telling the model not to retry automatically. payment_required normalizes v1 and v2 into x402Version, error, resource, and accepts[] entries with scheme, network, amount, asset, payTo, maxTimeoutSeconds, resource, and extra. The amount stays in atomic token units because the challenge does not always advertise the token decimals. The user-facing message lists the price, asset, network, recipient, and scheme for each accepted option.

PicoClaw never creates, signs, or sends a payment: it does not add X-PAYMENT or PAYMENT-SIGNATURE headers. A protected resource remains inaccessible until the payment is handled outside PicoClaw. A malformed or missing challenge still produces a clear "payment required" result instead of a generic request failure.