Skip to main content
Glama

mediawiki_edit_page

Destructive

Create new wiki pages or replace entire page content, with optional section edits and previews to prevent edit conflicts.

Instructions

Create new pages or rewrite entire page content.

USE WHEN: User says "create a new page", "rewrite the entire About page", "replace all content".

NOT FOR: Simple text changes (use mediawiki_find_replace). Not for formatting (use mediawiki_apply_formatting).

PARAMETERS:

  • title: Page name (required)

  • content: New page content (required)

  • section: Edit specific section only (optional)

  • summary: Edit summary (required for good practice)

  • minor: Mark as minor edit (default false)

  • bot: Mark as bot edit (default false)

  • base_timestamp: Revision timestamp from mediawiki_get_page (optional, recommended). When set, the edit fails with 'editconflict' if someone else changed the page since that revision, instead of silently overwriting their edit. On conflict: re-read with mediawiki_get_page and reapply.

  • preview: Preview changes without saving. Omit to preview (default true, for safety): the current revision is fetched, a line diff of what would change is returned, and nothing is written and no token is consumed. Set preview=false to apply the edit.

RETURNS: Preview (default): per-line diff of the planned content against the current revision ('changes' entries: before=removed line, after=added line, a modified line appears as its removal followed by its addition), plus new_page=true when the edit would create the page. With preview=false: revision ID, diff URL, and undo instructions.

NOTE: Requires authentication (bot password) to apply changes. Anonymous sessions cannot edit.

WARNING: This overwrites entire page content unless section is specified. Preview first (omit preview) before applying.

Input Schema

NameRequiredDescriptionDefault
botNoMark as bot edit (requires bot flag)
minorNoMark as minor edit
titleYesPage title to edit or create
contentYesNew page content in wikitext format
previewNoPreview changes without saving. Omitted means preview (the safe default): the edit is not saved, no token is consumed, and a line diff against the current revision is returned. Set false to apply the edit.
sectionNoSection to edit ('new' for new section, number for existing)
summaryNoEdit summary explaining the change
rationaleYesRequired one-sentence explanation of why you are making this change. Stored in the audit log for post-hoc intent reconstruction.
captcha_idNoCAPTCHA ID from a previous failed attempt, required when answering a CAPTCHA
captcha_wordNoUser-provided answer to the CAPTCHA challenge
base_timestampNoTimestamp of the revision this edit is based on (from get_page). When set, the wiki rejects the edit with an editconflict error if someone else edited the page in the meantime, instead of silently overwriting their change

Output Schema

NameRequiredDescriptionDefault
titleYes
changesNo
messageYes
page_idYes
previewYes
successYes
new_pageYes
page_urlNo
captcha_idNo
revision_idYes
captcha_typeNo
captcha_questionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv1.36.0
    • addedInput schema / properties / base_timestamp
      Added value: +{
      +  "description": "Timestamp of the revision this edit is based on (from get_page). When set, the wiki rejects the edit with an editconflict error if someone else edited the page in the meantime, instead of silently overwriting their change",
      +  "type": "string"
      +}
    • addedInput schema / properties / preview
      Added value: +{
      +  "description": "Preview changes without saving. Omitted means preview (the safe default): the edit is not saved, no token is consumed, and a line diff against the current revision is returned. Set false to apply the edit.",
      +  "type": [
      +    "null",
      +    "boolean"
      +  ]
      +}
    • addedOutput schema / properties / changes
      Added value: +{
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "after": {
      +        "type": "string"
      +      },
      +      "before": {
      +        "type": "string"
      +      },
      +      "context": {
      +        "type": "string"
      +      },
      +      "line": {
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "line",
      +      "before",
      +      "after"
      +    ],
      +    "type": "object"
      +  },
      +  "type": [
      +    "null",
      +    "array"
      +  ]
      +}
    • addedOutput schema / properties / preview
      Added value: +{
      +  "type": "boolean"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "success",
      -  "title",
      -  "page_id",
      -  "revision_id",
      -  "new_page",
      -  "message"
      -]New value: +[
      +  "success",
      +  "title",
      +  "page_id",
      +  "revision_id",
      +  "new_page",
      +  "message",
      +  "preview"
      +]
  2. Changed6 schema fields changedv1.32.0
    • addedInput schema / properties / captcha_id
      Added value: +{
      +  "description": "CAPTCHA ID from a previous failed attempt, required when answering a CAPTCHA",
      +  "type": "string"
      +}
    • addedInput schema / properties / captcha_word
      Added value: +{
      +  "description": "User-provided answer to the CAPTCHA challenge",
      +  "type": "string"
      +}
    • addedOutput schema / properties / captcha_id
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / captcha_question
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / captcha_type
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / page_url
      Added value: +{
      +  "type": "string"
      +}
  3. Changed2 schema fields changedv1.31.0
    • addedInput schema / properties / rationale
      Added value: +{
      +  "description": "Required one-sentence explanation of why you are making this change. Stored in the audit log for post-hoc intent reconstruction.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "title",
      -  "content"
      -]New value: +[
      +  "rationale",
      +  "title",
      +  "content"
      +]
  4. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare the write/destructive/openWorld profile, and the description adds substantially beyond it: authentication (bot password) required, anonymous sessions cannot edit, preview defaults to true and consumes no token, base_timestamp triggers an 'editconflict' failure rather than silent overwrite, and a recovery loop (re-read with mediawiki_get_page and reapply). Overwrite scope is also flagged in the WARNING.

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

Conciseness4/5

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

Well front-loaded and sectioned (USE WHEN / NOT FOR / PARAMETERS / RETURNS / NOTE / WARNING), so an agent can skim. There is mild repetition: preview is explained in PARAMETERS, again in RETURNS, and implied in the WARNING, and base_timestamp is stated twice in near-identical wording.

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 the full lifecycle an agent needs for a destructive write: prerequisites (auth), safe default (preview), concurrency protection (base_timestamp), failure recovery, and the shape of both preview and applied responses. Output schema exists but the extra prose about diffs and undo instructions is still useful context.

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; the description nevertheless adds real meaning, notably the preview null-vs-false semantics and the conflict-avoidance workflow for base_timestamp. It does not, however, cover captcha_id/captcha_word or the 'new'/numeric section convention, so it stops short of fully complementing 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 (create/rewrite) and resource (page content), and explicitly names the two sibling tools it is not for (mediawiki_find_replace, mediawiki_apply_formatting). An agent can distinguish this from every other mutating sibling without opening a 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?

Uses explicit USE WHEN triggers ('create a new page', 'rewrite the entire About page') and NOT FOR exclusions that route simple edits and formatting to the correct alternatives. Both the affirmative and negative cases are covered.

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