> For the complete documentation index, see [llms.txt](https://whitepaper.aitech.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://whitepaper.aitech.io/agentforge/tools/wikipedia.md).

# wikipedia

[Wikipedia](https://www.wikipedia.org/) is the world's largest free online encyclopedia, offering millions of articles on a vast range of topics, collaboratively written and maintained by volunteers.

The Agent Forge Wikipedia integration allows your agents to programmatically access and interact with Wikipedia content, incorporating data from the world's largest encyclopedia into their workflows.

With Wikipedia, you can:

* **Search for articles**: Find relevant Wikipedia pages by searching for keywords or topics
* **Get article summaries**: Retrieve concise summaries of Wikipedia pages for quick reference
* **Access full content**: Obtain the complete content of Wikipedia articles for in-depth information
* **Discover random articles**: Explore new topics by retrieving random Wikipedia pages

Agents can search for articles, fetch summaries, retrieve full page content, and discover random articles, empowering automations with up-to-date, reliable information.

This is ideal for research, content enrichment, fact-checking, and knowledge discovery, enabling agents to seamlessly use Wikipedia data in decision-making and task execution.

## Usage Instructions

Access Wikipedia articles, search for pages, get summaries, retrieve full content, and discover random articles from the world's largest encyclopedia.

## Tools

### `wikipedia_summary`

Get a summary and metadata for a specific Wikipedia page.

#### Input

| Parameter   | Type   | Required | Description                                    |
| ----------- | ------ | -------- | ---------------------------------------------- |
| `pageTitle` | string | Yes      | Title of the Wikipedia page to get summary for |

#### Output

| Parameter       | Type   | Description         |
| --------------- | ------ | ------------------- |
| `summary`       | json   | Page summary data   |
| `searchResults` | json   | Search results data |
| `totalHits`     | number | Total search hits   |
| `content`       | json   | Page content data   |
| `randomPage`    | json   | Random page data    |

### `wikipedia_search`

Search for Wikipedia pages by title or content.

#### Input

| Parameter     | Type   | Required | Description                                                |
| ------------- | ------ | -------- | ---------------------------------------------------------- |
| `query`       | string | Yes      | Search query to find Wikipedia pages                       |
| `searchLimit` | number | No       | Maximum number of results to return (default: 10, max: 50) |

#### Output

| Parameter       | Type   | Description         |
| --------------- | ------ | ------------------- |
| `summary`       | json   | Page summary data   |
| `searchResults` | json   | Search results data |
| `totalHits`     | number | Total search hits   |
| `content`       | json   | Page content data   |
| `randomPage`    | json   | Random page data    |

### `wikipedia_content`

Get the full HTML content of a Wikipedia page.

#### Input

| Parameter   | Type   | Required | Description                                    |
| ----------- | ------ | -------- | ---------------------------------------------- |
| `pageTitle` | string | Yes      | Title of the Wikipedia page to get content for |

#### Output

| Parameter       | Type   | Description         |
| --------------- | ------ | ------------------- |
| `summary`       | json   | Page summary data   |
| `searchResults` | json   | Search results data |
| `totalHits`     | number | Total search hits   |
| `content`       | json   | Page content data   |
| `randomPage`    | json   | Random page data    |

### `wikipedia_random`

Get a random Wikipedia page.

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |

#### Output

| Parameter       | Type   | Description         |
| --------------- | ------ | ------------------- |
| `summary`       | json   | Page summary data   |
| `searchResults` | json   | Search results data |
| `totalHits`     | number | Total search hits   |
| `content`       | json   | Page content data   |
| `randomPage`    | json   | Random page data    |

## Notes

* Category: `tools`
* Type: `wikipedia`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://whitepaper.aitech.io/agentforge/tools/wikipedia.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
