WebSearchSkill
Search the web using the Google Custom Search JSON API. The skill fetches more results than requested, scrapes each page, scores the extracted content, and returns only the highest-quality matches to the AI.
Class: WebSearchSkill
Tools: web_search (configurable via tool_name)
Env vars: GOOGLE_SEARCH_API_KEY, GOOGLE_SEARCH_ENGINE_ID (legacy
GOOGLE_SEARCH_CX is still accepted)
Multi-instance: yes — instance key combines search_engine_id and
tool_name.
api_key
Google Custom Search API key. Falls back to the GOOGLE_SEARCH_API_KEY
environment variable.
search_engine_id
Google Custom Search Engine ID. Falls back to the
GOOGLE_SEARCH_ENGINE_ID environment variable (or the legacy
GOOGLE_SEARCH_CX).
tool_name
Custom tool name for this Web Search instance (useful when registering multiple instances at once).
num_results
Number of high-quality results to return (range 1-10).
delay
Delay between scraping pages in seconds (minimum 0).
max_content_length
Maximum total response size in characters (minimum 1000).
oversample_factor
How many extra results to fetch for quality filtering — e.g. 2.5 fetches
2.5× the requested num_results before scoring. Range 1.0-3.5.
min_quality_score
Minimum quality score (0–1) required to include a result.
no_results_message
Message returned when no quality results are found. Use {query} as a
placeholder for the original search term.
safe_search
Safe-search level. One of "off", "medium", "high".
per_page_timeout
Maximum seconds to wait on a single page scrape. Minimum 0.1.
overall_deadline
Wall-clock budget in seconds for the entire tool call. In-flight scrapes are
abandoned past this point so the response beats the kernel webhook timeout.
Minimum 1.0.
parallel_scrape
Scrape all candidate pages concurrently (raced against the deadline) instead of sequentially.
snippets_only
Skip page scraping entirely and return Google CSE snippets only. The fastest mode (sub-second).
response_prefix
Optional text prepended (separated by a blank line) to every non-empty search result.
response_postfix
Optional text appended (separated by a blank line) to every non-empty search result.