Skip to main content
Glama
ProfessionalWiki

mediawiki-mcp-server

remove-wiki

Destructive

Remove a wiki from the MCP server resources by specifying its URI to manage MediaWiki connections.

Instructions

Removes a wiki from the MCP resources.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uriYesMCP resource URI of the wiki to remove (e.g. mcp://wikis/en.wikipedia.org)

Implementation Reference

  • Handler function that implements the core logic of the remove-wiki tool: parses URI, validates wiki existence and current status, removes from wikiService, updates resources, clears cache, handles errors.
    async function handleRemoveWikiTool( server: McpServer, uri: string ): Promise<CallToolResult> {
    	try {
    		const { wikiKey } = parseWikiResourceUri( uri );
    
    		const wikiToRemove = wikiService.get( wikiKey );
    		if ( !wikiToRemove ) {
    			return {
    				content: [ {
    					type: 'text',
    					text: `mcp://wikis/${ wikiKey } not found in MCP resources.`
    				} as TextContent ],
    				isError: true
    			};
    		}
    
    		if ( wikiService.getCurrent().key === wikiKey ) {
    			return {
    				content: [ {
    					type: 'text',
    					text: 'Cannot remove the currently active wiki. Please set a different wiki as the active wiki before removing this one.'
    				} as TextContent ],
    				isError: true
    			};
    		}
    
    		wikiService.remove( wikiKey );
    		server.sendResourceListChanged();
    		clearMwnCache();
    
    		return {
    			content: [ {
    				type: 'text',
    				text: `${ wikiToRemove.sitename } (mcp://wikis/${ wikiKey }) has been removed from MCP resources.`
    			} as TextContent ]
    		};
    	} catch ( error ) {
    		if ( error instanceof InvalidWikiResourceUriError ) {
    			return {
    				content: [ {
    					type: 'text',
    					text: error.message
    				} as TextContent ],
    				isError: true
    			};
    		}
    		throw error;
    	}
    }
  • Registers the remove-wiki tool with the MCP server, including name, description, input schema (uri: zod string), annotations, and links to the handler function.
    export function removeWikiTool( server: McpServer ): RegisteredTool {
    	return server.tool(
    		'remove-wiki',
    		'Removes a wiki from the MCP resources.',
    		{
    			uri: z.string().describe( 'MCP resource URI of the wiki to remove (e.g. mcp://wikis/en.wikipedia.org)' )
    		},
    		{
    			title: 'Remove wiki',
    			destructiveHint: true
    		} as ToolAnnotations,
    		( { uri } ) => handleRemoveWikiTool( server, uri )
    	);
    }
  • Zod input schema for the tool's 'uri' parameter.
    uri: z.string().describe( 'MCP resource URI of the wiki to remove (e.g. mcp://wikis/en.wikipedia.org)' )
  • The removeWikiTool registrar is included in the array of all tool registrars called by registerAllTools.
    removeWikiTool,
  • Global function that registers all tools, including remove-wiki, by invoking each registrar with the server instance.
    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;
    }
Behavior3/5

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

Annotations already declare destructiveHint=true, so the agent knows this is a destructive operation. The description adds no additional behavioral context beyond this, such as whether removal is permanent, requires specific permissions, or has side effects. It neither contradicts nor significantly enhances the annotations.

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, clear sentence with no wasted words, making it highly efficient and easy to parse. It's appropriately sized for a simple tool with one parameter.

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?

Given the tool's simplicity (one parameter, destructive annotation, no output schema), the description is minimally adequate. However, it lacks context on usage relative to siblings and doesn't explain what 'removes' entails behaviorally, leaving gaps in completeness for an agent's decision-making.

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%, with the 'uri' parameter fully documented in the schema. The description adds no extra meaning about the parameter, such as format examples or constraints beyond what the schema provides, so it meets the baseline for high schema coverage.

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 ('Removes') and resource ('a wiki from the MCP resources'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'delete-page' or 'undelete-page', which prevents a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'delete-page' or 'set-wiki', nor does it mention prerequisites such as needing the wiki URI. It states what it does but not when or why to use it.

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