Get Wikipedia Article Sections
wikipedia_get_sectionsFetch the table of contents for a Wikipedia article. Returns section titles, heading levels, section numbering (e.g. "2.1"), and section_index values. The first entry is the lead section, index 0, titled Introduction — the text above the first heading, which Wikipedia's own table of contents omits. Pass a section_index to wikipedia_get_article to retrieve just that section. Useful for enumerating article structure before doing a targeted section read. Redirect pages are followed automatically.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"title": "<title>"
},
"name": "wikipedia_get_sections"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Article title (e.g. "Python (programming language)"). A trailing #fragment is accepted and ignored; the characters < > [ ] { } and | cannot appear in a Wikipedia page name. Special: and Media: titles, and interwiki links such as "wikt:cat", name no page. | |
| language | No | Wikipedia language edition code (default "en"). Examples: "fr", "de", "ja". | en |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Present when the call failed. Absent on success. | |
| title | No | Article title as resolved by Wikipedia. | |
| notice | No | Guidance for a disambiguation page, whose sections group candidate articles. | |
| pageid | No | Wikipedia page ID. Absent for stub articles. | |
| language | No | Language edition queried. | |
| sections | No | Article sections in document order with index values for targeted reads, led by the index-0 lead entry. | |
| page_type | No | Present only on a disambiguation page — one that lists the articles a title can refer to — and then "disambiguation", the value wikipedia_get_summary reports for it. | |
| categories | No | Visible categories the article belongs to, without the namespace prefix and with spaces for underscores. Pass one to wikipedia_search_articles as incategory:"<name>", writing any double quote in the name as \". | |
| total_sections | No | Number of entries returned, counting the index-0 lead section. | |
| redirected_from | No | Original alias followed to this article. | |
| redirect_section | No | Target fragment of the redirect, normalized to its heading when matched. | |
| redirect_section_index | No | Unique numeric TOC index matching the redirect anchor. Absent when no index is verified. |