Overview
Wikipedia tool allows you to search Wikipedia and retrieve article content. No API key required. The user asks a factual question; the agent searches Wikipedia and returns a summary.Installation
Quick Start
Usage with Agent
Available Methods
search(query, max_results=5)
Search Wikipedia for articles.get_page(title)
Get full Wikipedia page content.summary(title, sentences=5)
Get a brief summary of an article.Configuration Options
Function-Based Usage
CLI Usage
Error Handling
Common Errors
| Error | Cause | Solution |
|---|---|---|
wikipedia not installed | Missing dependency | Run pip install wikipedia |
Disambiguation | Multiple pages match | Use one of the returned options |
Page not found | Article doesn’t exist | Check spelling or search first |
Supported Languages
Use ISO language codes:en- Englishes- Spanishfr- Frenchde- Germanzh- Chineseja- Japanese- And many more…
How It Works
Best Practices
No API key needed
No API key needed
Wikipedia works without credentials — ideal for quick factual lookups.
Handle disambiguation
Handle disambiguation
When a title matches multiple pages, pick from the returned options instead of guessing.
Summarise, don't dump
Summarise, don't dump
Fetch summaries rather than full articles so the agent works with fewer tokens.
Related Tools
ArXiv
Academic papers
PubMed
Medical research
HackerNews
Tech news

