Skip to main content
Glama
ProfessionalWiki

mediawiki-mcp-server

add-wiki

Destructive

Adds a new MediaWiki instance to the MCP server by providing any URL from the target wiki, enabling integration with MediaWiki resources.

Instructions

Adds a new wiki to the MCP resources from a URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wikiUrlYesAny URL from the target wiki (e.g. https://en.wikipedia.org/wiki/Main_Page)

Implementation Reference

  • The core handler function that implements the 'add-wiki' tool logic: discovers wiki from URL, adds it to wikiService, sends resource list change notification, with proper error handling.
    async function handleAddWikiTool( server: McpServer, wikiUrl: string ): Promise<CallToolResult> {
    	const wikiInfo = await discoverWiki( wikiUrl );
    
    	if ( wikiInfo === null ) {
    		return {
    			content: [
    				{
    					type: 'text',
    					text: 'Failed to determine wiki info. Please ensure the URL is correct and the wiki is accessible.'
    				} as TextContent
    			],
    			isError: true
    		};
    	}
    
    	try {
    		const newConfig = {
    			sitename: wikiInfo.sitename,
    			server: wikiInfo.server,
    			articlepath: wikiInfo.articlepath,
    			scriptpath: wikiInfo.scriptpath,
    			token: null,
    			private: false
    		};
    
    		wikiService.add( wikiInfo.servername, newConfig );
    		server.sendResourceListChanged();
    
    		return {
    			content: [
    				{
    					type: 'text',
    					text: `${ wikiInfo.sitename } (mcp://wikis/${ wikiInfo.servername }) has been added to MCP resources.`
    				} as TextContent
    			]
    		};
    	} catch ( error ) {
    		return {
    			content: [
    				{
    					type: 'text',
    					text: `Failed to add wiki: ${ ( error as Error ).message }`
    				} as TextContent
    			],
    			isError: true
    		};
    	}
    }
  • Registers the 'add-wiki' tool on the MCP server, defining its name, description, input schema (wikiUrl), annotations, and handler function.
    export function addWikiTool( server: McpServer ): RegisteredTool {
    	return server.tool(
    		'add-wiki',
    		'Adds a new wiki to the MCP resources from a URL.',
    		{
    			wikiUrl: z.string().url().describe( 'Any URL from the target wiki (e.g. https://en.wikipedia.org/wiki/Main_Page)' )
    		},
    		{
    			title: 'Add wiki',
    			destructiveHint: true
    		} as ToolAnnotations,
    		( { wikiUrl } ) => handleAddWikiTool( server, wikiUrl )
    	);
    }
  • Zod schema for the tool input: wikiUrl as a valid URL string.
    	wikiUrl: z.string().url().describe( 'Any URL from the target wiki (e.g. https://en.wikipedia.org/wiki/Main_Page)' )
    },
  • Central registration function that invokes all tool registrars, including addWikiTool, to register 'add-wiki' among other tools.
    export function registerAllTools( server: McpServer ): RegisteredTool[] {
    	const registeredTools: RegisteredTool[] = [];
    	for ( const registrar of toolRegistrars ) {
    		try {
    			registeredTools.push( registrar( server ) );
    		} catch ( error ) {
    			console.error( `Error registering tool: ${ ( error as Error ).message }` );
    		}
    	}
    	return registeredTools;
    }
  • src/tools/index.ts:9-9 (registration)
    Import of the addWikiTool registrar from its implementation file.
    import { addWikiTool } from './add-wiki.js';
Behavior3/5

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

Annotations provide destructiveHint=true, indicating this is a mutation. The description adds context about the source being a URL, which is useful beyond annotations. However, it doesn't disclose additional behavioral traits like permissions needed, side effects, or error handling, leaving gaps for a destructive operation.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the key action and resource. Every word earns its place, with no wasted text, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive tool with one parameter and no output schema, the description is minimally adequate. It covers the basic purpose but lacks details on outcomes, error cases, or integration with sibling tools, leaving room for improvement in completeness.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents the 'wikiUrl' parameter with format and example. The description adds minimal value by mentioning 'from a URL', which is redundant with the schema. Baseline 3 is appropriate as the schema handles parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Adds') and resource ('a new wiki to the MCP resources'), specifying it's from a URL. It distinguishes from siblings like 'set-wiki' or 'upload-file' by focusing on adding from a URL, but doesn't explicitly differentiate from all similar tools like 'upload-file-from-url'.

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool versus alternatives like 'set-wiki' or 'upload-file-from-url'. The description implies usage for adding wikis from URLs, but lacks context on prerequisites, exclusions, or comparisons with sibling tools.

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/ProfessionalWiki/MediaWiki-MCP-Server'

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