AgentsSkills

web_search

View as MarkdownOpen in Claude

Search the web using the Google Custom Search API. Results are filtered for quality and summarized for voice delivery.

Tools: web_search

Requirements: Google Custom Search API key + Search Engine ID

Multi-instance: Yes (use different tool_name and search_engine_id per instance)

api_key
strRequired

Google API key with Custom Search JSON API enabled.

search_engine_id
strRequired

Programmable Search Engine ID from Google.

num_results
intDefaults to 3

Number of search results to return (1-10).

delay
floatDefaults to 0.5

Delay between scraping pages in seconds.

max_content_length
intDefaults to 32768

Maximum total response size in characters.

oversample_factor
floatDefaults to 2.5

How many extra results to fetch for quality filtering (e.g., 2.5 fetches 2.5x the requested number). Range: 1.0-3.5.

min_quality_score
floatDefaults to 0.3

Quality threshold for filtering results (0.0-1.0).

no_results_message
str

Message to show when no quality results are found. Use {query} as a placeholder for the search query.

tool_name
strDefaults to web_search

Custom function name.

1from signalwire import AgentBase
2
3class MyAgent(AgentBase):
4 def __init__(self):
5 super().__init__(name="assistant", route="/assistant")
6 self.set_prompt_text("You are a helpful assistant.")
7 self.add_skill("web_search", {
8 "api_key": "YOUR_GOOGLE_API_KEY",
9 "search_engine_id": "YOUR_SEARCH_ENGINE_ID",
10 "num_results": 3
11 })
12
13agent = MyAgent()
14agent.serve()