kdeps-tools-wikipedia
v2.0.0Look up information on Wikipedia. Use for general knowledge questions about people, places, companies, historical events, concepts, or any topic needing an encyclopedic answer. Input is a search query.
set tools / shelf tools
LLM context: ~118 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.
- the agent loop builds the request
- the tool definitions are sent to the modeltools/wikipedia
- the model calls a tool
- kdeps runs it
- 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.
Pin a version with kdeps install tools/wikipedia@<version>.
Contents
Look up information on Wikipedia. Use for general knowledge questions about people, places, companies, historical events, concepts, or any topic needing an encyclopedic answer. Input is a search query.
- category
- web
- constraints
- good for general knowledge; not for real-time/current information
- outputFormat
- the title and introduction of the two best-matching articles
- seeAlso
- web_search, web_scraper
| Parameter | Type | Description |
|---|---|---|
| query * | string | The topic or question to look up on Wikipedia |
Python script (declared in YAML, no Go code)
import json, os, sys, urllib.error, urllib.parse, urllib.request
query = json.loads(sys.argv[1])["query"]
base = os.environ.get("WIKI_URL") or "https://en.wikipedia.org/w/api.php"
# One request: the two best matches (generator=search) with the
# plain-text introduction of each (prop=extracts; several need exintro).
params = {
"action": "query", "format": "json", "formatversion": "2",
"generator": "search", "gsrsearch": query, "gsrlimit": "2",
"prop": "extracts", "exintro": "1", "explaintext": "1", "exlimit": "2",
}
req = urllib.request.Request(base + "?" + urllib.parse.urlencode(params),
headers={"User-Agent": "kdeps/agent"})
try:
with urllib.request.urlopen(req, timeout=25) as resp:
data = json.load(resp)
except urllib.error.HTTPError as e:
sys.exit("wikipedia: responded with %d" % e.code)
except (urllib.error.URLError, ValueError) as e:
sys.exit("wikipedia: %s" % getattr(e, "reason", e))
pages = sorted((data.get("query") or {}).get("pages") or [], key=lambda p: p.get("index", 0))
if not pages:
print("no wikipedia pages found")
for p in pages:
print("%s\n%s\n" % (p.get("title", ""), (p.get("extract") or "").strip()))
Timeout: 30s
Offered when set: KDEPS_WIKIPEDIA_URL |
version: 2.0.0
category: web
description: Look up information on Wikipedia. Use for general knowledge questions about people, places, companies, historical events, concepts, or any topic needing an encyclopedic answer. Input is a search query.
constraints: good for general knowledge; not for real-time/current information
outputFormat: the title and introduction of the two best-matching articles
seeAlso: web_search, web_scraper
parameters:
query:
type: string
description: The topic or question to look up on Wikipedia
required: true
python:
timeout: 30s
env:
WIKI_URL: [KDEPS_WIKIPEDIA_URL, ""] # optional: a MediaWiki api.php endpoint (default en.wikipedia.org)
script: |
import json, os, sys, urllib.error, urllib.parse, urllib.request
query = json.loads(sys.argv[1])["query"]
base = os.environ.get("WIKI_URL") or "https://en.wikipedia.org/w/api.php"
# One request: the two best matches (generator=search) with the
# plain-text introduction of each (prop=extracts; several need exintro).
params = {
"action": "query", "format": "json", "formatversion": "2",
"generator": "search", "gsrsearch": query, "gsrlimit": "2",
"prop": "extracts", "exintro": "1", "explaintext": "1", "exlimit": "2",
}
req = urllib.request.Request(base + "?" + urllib.parse.urlencode(params),
headers={"User-Agent": "kdeps/agent"})
try:
with urllib.request.urlopen(req, timeout=25) as resp:
data = json.load(resp)
except urllib.error.HTTPError as e:
sys.exit("wikipedia: responded with %d" % e.code)
except (urllib.error.URLError, ValueError) as e:
sys.exit("wikipedia: %s" % getattr(e, "reason", e))
pages = sorted((data.get("query") or {}).get("pages") or [], key=lambda p: p.get("index", 0))
if not pages:
print("no wikipedia pages found")
for p in pages:
print("%s\n%s\n" % (p.get("title", ""), (p.get("extract") or "").strip()))
Versions
| Version | Published | Status |
|---|---|---|
| 2.0.0 | 10/24/2026 | active |
| 1.0.0 | 10/11/2026 | active |
Details
- Author
- kdeps
- License
- Apache-2.0
- Latest Version
- 2.0.0
- Published
- 10/11/2026