Skip to main content

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

No API key required!

Quick Start

1

Simple Usage

2

With Configuration

Use the same tool with an agent — see Usage with Agent below, or pass env vars and options from the sections above.
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

Supported Languages

Use ISO language codes:
  • en - English
  • es - Spanish
  • fr - French
  • de - German
  • zh - Chinese
  • ja - Japanese
  • And many more…

How It Works


Best Practices

Wikipedia works without credentials — ideal for quick factual lookups.
When a title matches multiple pages, pick from the returned options instead of guessing.
Fetch summaries rather than full articles so the agent works with fewer tokens.

ArXiv

Academic papers

PubMed

Medical research

HackerNews

Tech news