Skip to main content
The MediaWiki Search & Write Tool (mediawiki) is a mAItion Workspace Tool. It gives the LLM two on-demand functions: searching your wiki, and creating or updating wiki pages. Use search_wiki when the user asks to look something up on the wiki. Use save_to_wiki when the user asks to save, write, or update content on the wiki.

Authentication

username and password are optional. The tool connects anonymously when both are empty, and only attempts to log in when both are set. Credentials are not required for every wiki — only wikis that restrict the relevant action reject the request. Two distinct failure modes can occur, and the tool reports them differently: authentication failure (the supplied username/password are wrong — the tool reports this directly), and authorization failure (the acting user, whether anonymous or logged in, lacks permission for that specific action on this wiki — MediaWiki denies the request itself, independent of whether login succeeded). When credentials are needed, use a BotPassword (Special:BotPasswords on your wiki) rather than a real account password.

Connecting to the Wiki

wiki_url must be the full URL to your wiki’s api.php script (for example https://wiki.example.com/w/api.php), starting with http:// or https:// and including a resolvable host. The tool can derive a working site path even from a URL that doesn’t literally end in /api.php, but the supported and documented form is the full api.php URL.

Valves

Tool id: mediawiki. Display name: “MediaWiki Search & Write Tool”. Valves can be edited after install from Workspace → Tools in mAItion.

Enabling via ENV

This tool is opt-in. Installing it requires both of these:
  • TOOL_MEDIAWIKI_ENABLED=True
  • MEDIAWIKI_API_URL set to a non-empty value
If MEDIAWIKI_API_URL is missing while the flag is True, the entrypoint script skips the install and prints a warning to the container logs — it does not fail the boot, so the omission is easy to miss. MEDIAWIKI_USERNAME and MEDIAWIKI_PASSWORD are optional — set them if the wiki needs credentials. In .env:
At install, only three valves are set from ENV:
  • wiki_urlMEDIAWIKI_API_URL
  • usernameMEDIAWIKI_USERNAME
  • passwordMEDIAWIKI_PASSWORD
timeout, edit_summary, max_search_results, and max_page_chars are not configurable via ENV. They stay at their defaults above unless changed later from Workspace → Tools.
This installs only during first-start initialization — the setup that runs only once, the first time the container boots, gated on a marker file. Setting TOOL_MEDIAWIKI_ENABLED=True on an already-running instance does not install it retroactively.

Troubleshooting