mediawiki_upload_file
Upload files to a MediaWiki wiki from a URL or local file path, with optional description and overwrite control.
Instructions
Upload a file to the wiki from a URL or local path.
USE WHEN: User says "upload this image", "add file to wiki", "import document".
PARAMETERS:
filename: Target filename on wiki (required)
file_url: Source URL to fetch file from (one of file_url or file_path required)
file_path: Local file path (alternative to file_url)
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. URL must be publicly accessible.
SECURITY: Source URL must be on the MEDIAWIKI_UPLOAD_ALLOWED_DOMAINS env-var allowlist (fail-closed when unset). Private/internal IPs are blocked unconditionally. 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 |
|---|---|---|---|
| rationale | Yes | Required one-sentence explanation of why you are making this change. Stored in the audit log for post-hoc intent reconstruction. | |
| filename | Yes | Target filename on the wiki (e.g., 'Example.png') | |
| file_path | No | Local file path to upload | |
| file_url | No | URL to fetch and upload (alternative to file_path) | |
| text | No | File description page content (wikitext) | |
| comment | No | Upload comment for the log | |
| ignore_warnings | No | Ignore duplicate/overwrite warnings |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | Yes | ||
| filename | Yes | ||
| page_id | No | ||
| url | No | ||
| size | No | ||
| message | Yes | ||
| warnings | No |