tools: add web_fetch and web_search

web_fetch: HTTP GET, returns body as text. For reading docs, APIs, pages.
web_search: DuckDuckGo HTML search, no API key. Returns title/url/snippet.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
ProofOfConcept 2026-04-04 12:18:11 -04:00 committed by Kent Overstreet
parent fb54488f30
commit 22f955ad9f
2 changed files with 182 additions and 0 deletions

View file

@ -11,6 +11,7 @@ mod glob;
mod grep;
mod memory;
mod read;
mod web;
mod write;
// Agent-specific tools
@ -196,6 +197,8 @@ pub async fn dispatch_shared(
"write_file" => write::write_file(args),
"edit_file" => edit::edit_file(args),
"bash" => bash::run_bash(args).await,
"web_fetch" => web::web_fetch(args).await,
"web_search" => web::web_search(args).await,
"grep" => grep::grep(args),
"glob" => glob::glob_search(args),
_ => return None,
@ -216,6 +219,8 @@ pub fn definitions() -> Vec<ToolDef> {
write::definition(),
edit::definition(),
bash::definition(),
web::fetch_definition(),
web::search_definition(),
grep::definition(),
glob::definition(),
];