Skip to content

[Tool] Add WebSearchTool - multi-provider web search #233

Description

@omatheusmesmo

Motivation

The agent cannot search the web. For current events, documentation lookups, or finding information beyond its training data, the agent is completely blind. WebFetchTool handles fetching specific URLs, but the agent also needs the ability to discover URLs via search.

What the tool should do

Search the web using a query and return structured results (title, URL, snippet).

Reference implementations

opencode (TypeScript)

  • Providers: Exa, Parallel (via MCP JSON-RPC)
  • Parameters: query, numResults (max 20), livecrawl, type (auto/fast/deep)
  • 25 second timeout per provider

hermes-agent (Python)

  • Providers: Tavily, Exa, Parallel, Firecrawl, SearXNG, Brave Free, DuckDuckGo, xAI
  • Auto-detected from config/env vars
  • Parameters: query, limit (default 5, max 100)

openclaw (TypeScript)

  • Providers: Brave, Perplexity, DuckDuckGo, Google, xAI/Grok, SearXNG, Moonshot/Kimi, MiniMax, Ollama
  • Parameters: query, count, country, language, freshness, date_after, date_before, domain_filter

Requirements

  1. Pluggable providers - Support multiple search backends, configured at build/runtime
  2. Recommended default - DuckDuckGo (free, no API key) as the default
  3. Structured results - Return list of {title, url, snippet}
  4. Result count - Configurable (default 5, max 20)
  5. Timeout - Configurable (default 15s)
  6. SSRF protection - Same as WebFetchTool

Suggested location

client/runtime/src/main/java/dev/omatheusmesmo/qlawkus/tool/web/WebSearchTool.java

Config properties

  • qlawkus.web.search.enabled (boolean, default true)
  • qlawkus.web.search.provider (string: duckduckgo | brave | tavily | exa)
  • qlawkus.web.search.api-key (string, optional - not needed for DuckDuckGo)
  • qlawkus.web.search.max-results (int, default 5)
  • qlawkus.web.search.timeout (Duration, default 15s)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttoolingTools and utilities

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions