Alphakdeps.io is experimental and evolving — the registry and packages may change or reset.
Toolkdeps asset

kdeps-tools-web_search

v2.0.0

Search the web using DuckDuckGo. Free, no API key required. Use for current events, facts, research, or anything needing an internet lookup. Input is a plain search query string.

set tools / shelf tools

LLM context: ~109 tokens when loaded (prompt or tool definition)

Where it runs

Part of the tools set, used in workflow and agent mode. What the model is told about each built-in tool: its description, usage notes and parameters. kdeps runs the tool itself.

  1. the agent loop builds the request
  2. the tool definitions are sent to the modeltools/web_search
  3. the model calls a tool
  4. kdeps runs it
  5. the result goes back to the model

Loaded by: kdeps (agent loop), /update, /settings, kdeps run, kdeps install, kdeps list, kdeps uninstall, kdeps update

In the code: kdeps (agent loop)agent.RegisterBuiltinToolsagent.definedAs

Install

A kdeps asset: installed with the first-run profile that includes its set, or the first time a command needs it, and updated without a new release.

kdeps install tools/web_search

Pin a version with kdeps install tools/web_search@<version>.

Contents

Search the web using DuckDuckGo. Free, no API key required. Use for current events, facts, research, or anything needing an internet lookup. Input is a plain search query string.

category
web
constraints
limit searches to 3 per topic; never repeat the same query; US-only results
outputFormat
up to 5 results, each as Title, Description and URL lines
seeAlso
web_scraper, wikipedia
ParameterTypeDescription
query *stringThe search query to look up

Python script (declared in YAML, no Go code)

import json, os, sys, urllib.error, urllib.parse, urllib.request
from html.parser import HTMLParser

MAX_RESULTS = 5
query = json.loads(sys.argv[1])["query"]
base = os.environ.get("SEARCH_URL") or "https://lite.duckduckgo.com/lite/"
url = base + "?q=" + urllib.parse.quote_plus(query)
req = urllib.request.Request(url, headers={"User-Agent": "kdeps/agent"})
try:
    with urllib.request.urlopen(req, timeout=25) as resp:
        page = resp.read().decode("utf-8", "replace")
except urllib.error.HTTPError as e:
    sys.exit("web_search: duckduckgo responded with %d" % e.code)
except urllib.error.URLError as e:
    sys.exit("web_search: %s" % e.reason)

class Results(HTMLParser):
    # Collects the title link and the snippet of each search result, in
    # the lite page's markup (result-link, result-snippet) or the html
    # page's (result__a, result__snippet).
    def __init__(self):
        super().__init__()
        self.results, self.field, self.depth = [], None, 0

    def handle_starttag(self, tag, attrs):
        if self.field:
            self.depth += 1
            return
        a = dict(attrs)
        classes = (a.get("class") or "").split()
        if "result-link" in classes or "result__a" in classes:
            href = a.get("href") or ""
            # Result links go through a redirect that carries the target in uddg.
            target = urllib.parse.parse_qs(urllib.parse.urlparse(href).query).get("uddg")
            self.results.append({"title": "", "info": "", "url": target[0] if target else href})
            self.field, self.depth = "title", 0
        elif ("result-snippet" in classes or "result__snippet" in classes) and self.results:
            self.field, self.depth = "info", 0

    def handle_endtag(self, tag):
        if not self.field:
            return
        if self.depth == 0:
            self.field = None
        else:
            self.depth -= 1

    def handle_data(self, data):
        if self.field:
            self.results[-1][self.field] += data

parser = Results()
parser.feed(page)
for r in parser.results[:MAX_RESULTS]:
    print("Title: %s\nDescription: %s\nURL: %s\n" % (r["title"].strip(), " ".join(r["info"].split()), r["url"]))

Timeout: 30s

Offered when set: KDEPS_WEB_SEARCH_URL |

aliases:
  - websearch
  - search_web
  - internet_search

Versions

VersionPublishedStatus
2.0.010/24/2026active
1.1.010/17/2026active
1.0.010/11/2026active

Details

Author
kdeps
License
Apache-2.0
Latest Version
2.0.0
Published
10/11/2026

Tags

kdepstool