Skip to main content
Glama

mediawiki_get_sections

Read-only

Retrieve a MediaWiki page's section headings and table of contents, or fetch a specific section's wikitext or HTML. Use it to list sections or get one section without loading the full page.

Instructions

Get page section structure (TOC) or specific section content.

USE WHEN: User asks "what sections does X have", "show the table of contents", "get the Installation section".

NOT FOR: Full page content (use mediawiki_get_page).

PARAMETERS:

  • title: Page name (required)

  • section: Section index to retrieve content (optional; omit for TOC only)

  • format: "wikitext" (default) or "html" (for section content)

RETURNS: Section headings with indices, or specific section content.

Input Schema

NameRequiredDescriptionDefault
titleYesPage title to get sections from
formatNoOutput format for section content: 'wikitext' (default) or 'html'
sectionNoSpecific section number to retrieve content for (0 = intro, 1+ = sections). Omit to list all sections.
rationaleNoOptional one-sentence explanation of why you are calling this tool. Used for audit trails when present.

Output Schema

NameRequiredDescriptionDefault
titleYes
formatNo
messageNo
page_idYes
sectionsNo
section_titleNo
section_contentNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.31.0
    • addedInput schema / properties / rationale
      Added value: +{
      +  "description": "Optional one-sentence explanation of why you are calling this tool. Used for audit trails when present.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is carried structurally; the description adds only a RETURNS line. It leaves the idempotentHint=false unexplained (a read that is flagged non-idempotent is worth a note), and says nothing about pagination or size limits. Modest added value over the annotations.

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

Conciseness5/5

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

Front-loaded purpose, then labeled USE WHEN / NOT FOR / PARAMETERS / RETURNS blocks. Every line earns its place with no redundant prose.

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

Completeness4/5

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

With an output schema present and annotations covering read-only/open-world behavior, the description need not explain return values, and it correctly focuses on routing. The only gap is the unremarked non-idempotent flag and absent mention of the rationale audit parameter.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description restates title, section, and format without adding syntax or semantics the schema lacks – the '0 = intro, 1+ = sections' indexing detail lives in the schema, not the description. The rationale param is not mentioned at all, though the schema documents it.

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 ('Get page section structure (TOC) or specific section content') with two clearly delineated modes. It explicitly names the sibling it is not (mediawiki_get_page for full content), so an agent can distinguish it without opening either schema.

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?

An explicit USE WHEN block gives concrete user phrasings ('what sections does X have', 'show the table of contents', 'get the Installation section'), and a NOT FOR block routes full-page requests to mediawiki_get_page. When-to-use and when-not-to-use are both covered.

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