Skip to main content
Glama

wikipedia-mcp-server

Get Wikipedia Article

wikipedia_get_article
Read-only

Fetch article content as clean plain text. Without section_index: returns the full article with == Section == markers preserved for structure — or, when the article exceeds the size budget, a compact section outline (truncated: true) that points to wikipedia_get_sections plus a section_index read instead of the full text. With section_index (from wikipedia_get_sections): returns that section and every subsection nested under it, each heading above its own body. section_index 0 is the lead section, the text above the first heading, which is the full prose wikipedia_get_summary returns only a truncated fragment of. Section-targeted reads are faster and smaller when only part of the article is needed. Both paths keep superscripts and subscripts apart from the text beside them (10²³, H₂O), render formulas as their TeX, and render code samples as fenced blocks with their indentation intact. A section read also renders data tables as pipe-delimited rows (header row first) and infoboxes as "label: value" lines; a table too large to include leaves a "[table omitted: N rows (table T)]" marker. Pass table_index: T with section_index to read only that table in complete row pages whose table text fits within 40,000 UTF-8 bytes on both surfaces. Follow next_cursor as cursor with the same inputs to continue at the pinned revision; caption/header/delimiter appear once. An indivisible oversized row or first-page caption/header is returned alone with oversized_row: true. The full-article path carries no data tables or infoboxes, so read the section for those. Phylogenetic clade trees render as fenced, indented branches, with unnamed forks preserved; unparseable trees leave "[table omitted: unparseable clade]". Clade trees have no table_index. Tables used only for layout, such as multi-column lists, keep their content as ordinary text. Page furniture is omitted as well — maintenance banners, sister-project and library-resource boxes, portal bars, and spoken-article notices — while a hatnote naming a related article is kept. Every read returns the canonical article URL and the ID of the revision it was read from, for citation; a full read also returns that revision's timestamp. Redirect pages are followed automatically, and the citation fields name the target article.

Input Schema

NameRequiredDescriptionDefault
titleYesArticle title (e.g. "Python (programming language)"). A trailing #fragment is accepted and ignored; the characters < > [ ] { } and | cannot appear in a Wikipedia page name.
cursorNoOpaque next_cursor from the previous table page. Keep title, language, section_index and table_index unchanged. Empty means the first page.
languageNoWikipedia language edition code (default "en"). Examples: "fr", "de", "ja".en
table_indexNo1-based outer wikitable or infobox ordinal in the section. Requires section_index. Returns only that table in complete row pages; nested cell tables have no ordinal.
section_indexNoSection index from wikipedia_get_sections. 0 reads the lead section (Introduction) — the text above the first heading. Omit for the full article. Providing this returns the targeted section plus every subsection nested under it, as plain text.

Output Schema

NameRequiredDescriptionDefault
urlNoCanonical desktop URL of the article (e.g. "https://en.wikipedia.org/wiki/Eiffel_Tower"), for citing the page rather than composing a URL from the title.
errorNoPresent when the call failed. Absent on success.
titleNoResolved article title.
noticeNoRedirect guidance or disclosure that optional TOC verification was unavailable.
pageidNoWikipedia page ID. Absent on API parse responses that omit it.
contentNoPlain-text article content. Both full articles and section reads carry == Section == markers above the text each one heads, code samples as ``` fenced blocks, and superscripts and subscripts as Unicode characters (10²³, H₂O), or as ^x / ^(…) and _x / _(…) where a character has none. Section reads also carry data tables as | cell | cell | rows with a | --- | row under the header. When truncated is true, this instead carries a section outline (heading names and byte sizes) plus a pointer to the targeted-read path.
languageNoLanguage edition queried.
truncatedNoTrue when a full-article read exceeded the size budget and content is a section outline instead of the full text. Always false for section reads and for full articles within budget.
row_offsetNoZero-based first row position in this page.
table_rowsNoTotal rendered rows, including the first header row.
next_cursorNoPass unchanged as cursor with the same table request to read the pinned revision. Absent on the final page.
revision_idNoID of the revision the content was read from. "https://<edition>.wikipedia.org/w/index.php?oldid=<revision_id>" is a permanent link to exactly that version.
table_countNoAvailable outer data tables in the pinned section.
table_indexNoSelected table ordinal, for table reads only.
content_typeNoContent type: "full_article" or "section".
last_modifiedNoISO 8601 timestamp of that revision, for dating the content. Full-article reads only; a section read carries none.
oversized_rowNoTrue when an indivisible row or first-page caption/header exceeds the 40,000-byte table-text budget and is returned alone.
rows_returnedNoNumber of complete rows returned in this page.
section_titleNoSection title when section_index was provided — "Introduction" for the lead, which has no heading of its own. Absent for full-article reads.
original_lengthNoCharacter length of the full article text before outlining. Present only when truncated is true.
redirected_fromNoOriginal alias followed to the resolved article.
table_continuedNoTrue for a headerless continuation page.
redirect_sectionNoRedirect target fragment, or its normalized heading when verified. Explicit section_index still controls the read.
sections_suggestedNoTrue when content is an outline — use its verified section_index values with wikipedia_get_article, or call wikipedia_get_sections for unindexed entries. Present only when truncated is true.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changed
    • addedInput schema / properties / cursor
      Added value: +{
      +  "description": "Opaque next_cursor from the previous table page. Keep title, language, section_index and table_index unchanged. Empty means the first page.",
      +  "type": "string"
      +}
    • addedInput schema / properties / table_index
      Added value: +{
      +  "description": "1-based outer wikitable or infobox ordinal in the section. Requires section_index. Returns only that table in complete row pages; nested cell tables have no ordinal.",
      +  "maximum": 9007199254740991,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `not_found`: No Wikipedia article exists for the given title. `invalid_title`: The title contains characters MediaWiki cannot name a page with. `invalid_section`: The section_index is out of range for this article. `invalid_language`: The language is not a valid BCP 47 code, or names a Wikipedia edition that does not exist. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `invalid_table`: A table selector is unavailable or section_index/table_index is missing for a table read. `invalid_cursor`: A table cursor is malformed, mismatched, or points past the pinned table. `revision_unavailable`: The pinned table revision cannot be read or verified. `not_found`: No Wikipedia article exists for the given title. `invalid_title`: The title contains characters MediaWiki cannot name a page with. `invalid_section`: The section_index is out of range for this article. `invalid_language`: The language is not a valid BCP 47 code, or names a Wikipedia edition that does not exist. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "not_found",
      -  "invalid_title",
      -  "invalid_section",
      -  "invalid_language"
      -]New value: +[
      +  "invalid_table",
      +  "invalid_cursor",
      +  "revision_unavailable",
      +  "not_found",
      +  "invalid_title",
      +  "invalid_section",
      +  "invalid_language"
      +]
    • addedOutput schema / properties / next_cursor
      Added value: +{
      +  "description": "Pass unchanged as cursor with the same table request to read the pinned revision. Absent on the final page.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / oversized_row
      Added value: +{
      +  "description": "True when an indivisible row or first-page caption/header exceeds the 40,000-byte table-text budget and is returned alone.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / row_offset
      Added value: +{
      +  "description": "Zero-based first row position in this page.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / rows_returned
      Added value: +{
      +  "description": "Number of complete rows returned in this page.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / table_continued
      Added value: +{
      +  "description": "True for a headerless continuation page.",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / table_count
      Added value: +{
      +  "description": "Available outer data tables in the pinned section.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / table_index
      Added value: +{
      +  "description": "Selected table ordinal, for table reads only.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / table_rows
      Added value: +{
      +  "description": "Total rendered rows, including the first header row.",
      +  "type": "number"
      +}
  2. Changed4 schema fields changed
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Redirect guidance or disclosure that optional TOC verification was unavailable.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / redirect_section
      Added value: +{
      +  "description": "Redirect target fragment, or its normalized heading when verified. Explicit section_index still controls the read.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / redirected_from
      Added value: +{
      +  "description": "Original alias followed to the resolved article.",
      +  "type": "string"
      +}
    • changedOutput schema / properties / sections_suggested / description
      Previous value: -"True when content is an outline — call wikipedia_get_sections, then wikipedia_get_article with a section_index to read a specific section. Present only when truncated is true."New value: +"True when content is an outline — use its verified section_index values with wikipedia_get_article, or call wikipedia_get_sections for unindexed entries. Present only when truncated is true."
  3. Changed4 schema fields changed
    • changedOutput schema / properties / content / description
      Previous value: -"Plain-text article content. Both full articles and section reads carry == Section == markers above the text each one heads. When truncated is true, this instead carries a section outline (heading names and byte sizes) plus a pointer to the targeted-read path."New value: +"Plain-text article content. Both full articles and section reads carry == Section == markers above the text each one heads, code samples as ``` fenced blocks, and superscripts and subscripts as Unicode characters (10²³, H₂O), or as ^x / ^(…) and _x / _(…) where a character has none. Section reads also carry data tables as | cell | cell | rows with a | --- | row under the header. When truncated is true, this instead carries a section outline (heading names and byte sizes) plus a pointer to the targeted-read path."
    • addedOutput schema / properties / last_modified
      Added value: +{
      +  "description": "ISO 8601 timestamp of that revision, for dating the content. Full-article reads only; a section read carries none.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / revision_id
      Added value: +{
      +  "description": "ID of the revision the content was read from. \"https://<edition>.wikipedia.org/w/index.php?oldid=<revision_id>\" is a permanent link to exactly that version.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / url
      Added value: +{
      +  "description": "Canonical desktop URL of the article (e.g. \"https://en.wikipedia.org/wiki/Eiffel_Tower\"), for citing the page rather than composing a URL from the title.",
      +  "type": "string"
      +}
  4. Changed8 schema fields changed
    • changedInput schema / properties / section_index / description
      Previous value: -"Section index from wikipedia_get_sections. Omit for the full article. Providing this returns the targeted section plus every subsection nested under it, as plain text."New value: +"Section index from wikipedia_get_sections. 0 reads the lead section (Introduction) — the text above the first heading. Omit for the full article. Providing this returns the targeted section plus every subsection nested under it, as plain text."
    • addedInput schema / properties / section_index / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / section_index / minimum
      Added value: +0
    • changedInput schema / properties / section_index / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / title / description
      Previous value: -"Article title (e.g. \"Python (programming language)\")."New value: +"Article title (e.g. \"Python (programming language)\"). A trailing #fragment is accepted and ignored; the characters < > [ ] { } and | cannot appear in a Wikipedia page name."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `not_found`: No Wikipedia article exists for the given title. `invalid_section`: The section_index is out of range for this article. `invalid_language`: The language is not a valid BCP 47 code, or names a Wikipedia edition that does not exist. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `not_found`: No Wikipedia article exists for the given title. `invalid_title`: The title contains characters MediaWiki cannot name a page with. `invalid_section`: The section_index is out of range for this article. `invalid_language`: The language is not a valid BCP 47 code, or names a Wikipedia edition that does not exist. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "not_found",
      -  "invalid_section",
      -  "invalid_language"
      -]New value: +[
      +  "not_found",
      +  "invalid_title",
      +  "invalid_section",
      +  "invalid_language"
      +]
    • changedOutput schema / properties / section_title / description
      Previous value: -"Section title when section_index was provided. Absent for full-article reads."New value: +"Section title when section_index was provided — \"Introduction\" for the lead, which has no heading of its own. Absent for full-article reads."
  5. First observed

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint/openWorldHint, yet the description adds substantial behavior: size-budget truncation with truncated: true plus a section outline, omission markers for oversized tables and unparseable clade trees, page-furniture removal rules, redirect following, revision pinning for pagination, and revision/URL citation fields. It discloses edge-case failure shapes (oversized_row: true) that no annotation covers.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded correctly, leading with the core full-article vs. section behavior, but it is a single ~250-word paragraph that mixes primary usage, pagination mechanics, and niche rendering rules (phylogenetic clade trees, hatnotes, portal bars) with no structure. Several clauses about rendering quirks could be trimmed or deferred given an output schema exists.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers everything an agent needs: how to get the full article, how the size budget changes the result, how to escalate to a section or table read, how pagination resumes, and what citation metadata comes back. With an output schema present, remaining return-shape detail is already handled there.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: section_index 0 is the lead section and a section read includes all nested subsections, table_index must be paired with section_index, and cursor must be replayed with the same inputs at the pinned revision. These clarify interaction constraints between parameters rather than restating the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Fetch article content as clean plain text") and immediately distinguishes the two modes (full article vs. section_index read). It names siblings wikipedia_get_sections and wikipedia_get_summary and explains how it differs from each, so an agent can pick it apart from siblings without reading further.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit branching: omit section_index for full article, pass it for a section, and explains that truncated full reads point to wikipedia_get_sections plus a section_index read instead. It also states the selection heuristic ("Section-targeted reads are faster and smaller when only part of the article is needed") and notes the full-article path carries no tables, so the section path is required for those.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.