Intelligent web search agent that automatically uses autonomous agent fallback when WebSearch API fails
Provides robust web search with automatic fallback to autonomous agents when API fails.
/plugin marketplace add bejranonda/LLM-Autonomous-Agent-Plugin-for-Claude/plugin install bejranonda-autonomous-agent@bejranonda/LLM-Autonomous-Agent-Plugin-for-ClaudeIntelligent web search agent that automatically switches to the autonomous agent approach (Task tool with general-purpose agent) when the WebSearch API fails or hits limits. This uses the ONLY proven working fallback method.
# First attempt with native WebSearch
result = WebSearch(query)
if result and "Did 0 searches" not in str(result):
return result
Triggers fallback when:
# Use autonomous agent - the ONLY working fallback
result = Task(
subagent_type='general-purpose',
prompt=f'Research and provide comprehensive information about: {query}'
)
⚠️ IMPORTANT: HTML scraping methods (curl, grep, etc.) are BROKEN and should NOT be used.
When searching for web content:
def smart_web_search(query):
"""
Smart search with WORKING fallback using autonomous agents.
HTML scraping is BROKEN - don't use it!
"""
# Try WebSearch first
try:
result = WebSearch(query)
if result and "Did 0 searches" not in str(result):
return result
except:
pass
# Automatic fallback to AUTONOMOUS AGENT (WORKS!)
print("[WebSearch failed, using autonomous agent fallback...]")
# This is the ONLY working fallback method
return Task(
subagent_type='general-purpose',
prompt=f'Research the following topic and provide comprehensive information: {query}'
)
# ⚠️ DO NOT USE HTML SCRAPING - IT'S BROKEN!
# The following methods NO LONGER WORK:
# - curl + grep (broken due to HTML changes)
# - python3 lib/web_search_fallback.py (uses broken scraping)
# - Any HTML parsing approach (bot protection blocks it)
| Error | Detection | Action |
|---|---|---|
| API limit | "rate limit exceeded" | Use fallback |
| Network timeout | Connection error | Retry with fallback |
| Empty results | "Did 0 searches" | Try alternative query |
| Tool not found | WebSearch unavailable | Direct to fallback |
The orchestrator can delegate to this agent when:
task_type: web_search
query: "AI trends 2025"
fallback_enabled: true
cache_enabled: true
num_results: 10
status: success
method_used: fallback
results_count: 10
response_time: 2.3s
cached: false
For users experiencing WebSearch issues:
No configuration needed - works automatically!
Use this agent to verify that a Python Agent SDK application is properly configured, follows SDK best practices and documentation recommendations, and is ready for deployment or testing. This agent should be invoked after a Python Agent SDK app has been created or modified.
Use this agent to verify that a TypeScript Agent SDK application is properly configured, follows SDK best practices and documentation recommendations, and is ready for deployment or testing. This agent should be invoked after a TypeScript Agent SDK app has been created or modified.