Skip to main content
Glama

mediawiki_upload_file

Destructive

Upload files to a wiki by providing base64-encoded data or a public URL, with optional file description and overwrite control.

Instructions

Upload a file to the wiki from base64 bytes or a URL.

USE WHEN: User says "upload this image", "add file to wiki", "import document".

PARAMETERS:

  • filename: Target filename on wiki (required)

  • file_data: Base64-encoded file contents (one of file_data or file_url required). Use this when you already have the bytes; it skips the URL-fetch path. Mutually exclusive with file_url.

  • file_url: Source URL for the wiki to fetch (alternative to file_data). Mutually exclusive with file_data.

  • text: File description page content (optional)

  • comment: Upload comment (optional)

  • ignore_warnings: Overwrite existing file (default false)

RETURNS: Upload status and file page URL. Includes revision ID, diff URL, and undo instructions.

NOTE: Requires authentication. For file_url, the URL must be publicly accessible.

SECURITY: file_data uploads bytes directly and never triggers a server-side fetch, so the allowlist/SSRF gates do not apply to that path. For file_url, the source host must be on the MEDIAWIKI_UPLOAD_ALLOWED_DOMAINS env-var allowlist (fail-closed when unset), and private/internal IPs are blocked unconditionally. Decoded file_data is capped at 100 MiB by default — matching MediaWiki's default max upload size — and is adjustable via MEDIAWIKI_MAX_UPLOAD_DATA_BYTES. ignore_warnings=true overwrites existing files; the destructive-hint annotation is set so hosts that gate destructive operations will prompt before this runs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNoFile description page content (wikitext)
commentNoUpload comment for the log
file_urlNoURL to fetch and upload. Mutually exclusive with file_data.
filenameYesTarget filename on the wiki (e.g., 'Example.png')
file_dataNoBase64-encoded file contents to upload directly (standard base64, RFC 4648). Use this for files the agent already has — it avoids the URL-fetch path and its allowlist/SSRF gates. Mutually exclusive with file_url.
file_pathNoLocal file path to upload (rejected via MCP; CLI use FileData)
rationaleYesRequired one-sentence explanation of why you are making this change. Stored in the audit log for post-hoc intent reconstruction.
ignore_warningsNoIgnore duplicate/overwrite warnings

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNo
sizeNo
messageYes
page_idNo
successYes
filenameYes
warningsNo
Behavior5/5

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

The description details behavioral traits beyond annotations: security constraints (SSRF, allowlist, file size cap), destructive behavior (ignore_warnings=true overwrites), and authentication requirement. Annotations provide destructiveHint=true, and the description reinforces this with specifics.

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-structured with clear sections (USE WHEN, PARAMETERS, RETURNS, NOTE, SECURITY). Front-loaded with purpose. Slightly long but each section adds value; could be more concise by removing repetition in parameter descriptions.

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?

Covers parameters, return values (status, URL, revision ID, undo instructions), authentication, security, and size limits. Output schema exists but description provides useful context. However, it lacks explicit details about error conditions (e.g., what happens on failure).

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

Parameters5/5

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

The description adds meaning beyond the input schema: explains mutual exclusivity of file_data and file_url, mentions that file_data skips URL-fetch path, notes that file_path is rejected via MCP, and describes behavior of ignore_warnings. Schema coverage is 100% but description enriches understanding.

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?

The description clearly states 'Upload a file to the wiki from base64 bytes or a URL.' It uses a specific verb ('Upload') and resource ('file to the wiki'), distinguishing it from siblings like mediawiki_edit_page which edits text content.

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

Usage Guidelines4/5

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

The description includes a 'USE WHEN' section with concrete examples ('upload this image', 'add file to wiki', 'import document'). It explains when to use file_data vs file_url (mutually exclusive) but does not explicitly state when not to use this tool.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/olgasafonova/mediawiki-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server