mediawiki_upload_file
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
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | File description page content (wikitext) | |
| comment | No | Upload comment for the log | |
| file_url | No | URL to fetch and upload. Mutually exclusive with file_data. | |
| filename | Yes | Target filename on the wiki (e.g., 'Example.png') | |
| file_data | No | Base64-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_path | No | Local file path to upload (rejected via MCP; CLI use FileData) | |
| rationale | Yes | Required one-sentence explanation of why you are making this change. Stored in the audit log for post-hoc intent reconstruction. | |
| ignore_warnings | No | Ignore duplicate/overwrite warnings |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| size | No | ||
| message | Yes | ||
| page_id | No | ||
| success | Yes | ||
| filename | Yes | ||
| warnings | No |