Skip to main content
Glama
ProfessionalWiki

mediawiki-mcp-server

delete-page

Destructive

Remove wiki pages from MediaWiki by specifying the page title and providing a deletion reason to maintain content quality.

Instructions

Deletes a wiki page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesWiki page title
commentNoReason for deleting the page

Implementation Reference

  • Core handler function that executes the page deletion using mwn.delete, handles errors, and returns formatted result or error.
    async function handleDeletePageTool(
    	title: string,
    	comment?: string
    ): Promise<CallToolResult> {
    	let data: ApiDeleteResponse;
    	try {
    		const mwn = await getMwn();
    		data = await mwn.delete( title, formatEditComment( 'delete-page', comment ) );
    	} catch ( error ) {
    		return {
    			content: [
    				{
    					type: 'text',
    					text: `Delete failed: ${ ( error as Error ).message }`
    				} as TextContent
    			],
    			isError: true
    		};
    	}
    
    	return {
    		content: deletePageToolResult( data )
    	};
    }
  • Registers the 'delete-page' tool with the MCP server, defining input schema (title, optional comment), annotations, description, and links to the handler function.
    export function deletePageTool( server: McpServer ): RegisteredTool {
    	return server.tool(
    		'delete-page',
    		'Deletes a wiki page.',
    		{
    			title: z.string().describe( 'Wiki page title' ),
    			comment: z.string().optional().describe( 'Reason for deleting the page' )
    		},
    		{
    			title: 'Delete page',
    			readOnlyHint: false,
    			destructiveHint: true
    		} as ToolAnnotations,
    		async (
    			{ title, comment }
    		) => handleDeletePageTool( title, comment )
    	);
    }
  • Helper function to format the successful API delete response into TextContent array.
    function deletePageToolResult( data: ApiDeleteResponse ): TextContent[] {
    	return [
    		{
    			type: 'text',
    			text: `Page deleted successfully: ${ data.title }`
    		}
    	];
    }
  • Central registration function that invokes deletePageTool (among others) to register all tools with the server.
    const toolRegistrars = [
    	getPageTool,
    	getPageHistoryTool,
    	searchPageTool,
    	setWikiTool,
    	addWikiTool,
    	removeWikiTool,
    	updatePageTool,
    	getFileTool,
    	createPageTool,
    	uploadFileTool,
    	uploadFileFromUrlTool,
    	deletePageTool,
    	getRevisionTool,
    	undeletePageTool,
    	getCategoryMembersTool,
    	searchPageByPrefixTool
    ];
    
    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/server.ts:15-30 (registration)
    Top-level server creation where registerAllTools is called, indirectly registering the delete-page tool.
    const server = new McpServer(
    	{
    		name: SERVER_NAME,
    		version: SERVER_VERSION
    	},
    	{
    		capabilities: {
    			resources: {
    				listChanged: true
    			}
    		}
    	}
    );
    
    registerAllTools( server );
    registerAllResources( server );
Behavior4/5

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

Annotations indicate destructiveHint=true and readOnlyHint=false, which already signal a non-read-only, destructive operation. The description adds value by specifying the resource type ('wiki page'), but it doesn't disclose additional behavioral traits like whether deletions are permanent, require admin rights, or have rate limits. No contradiction with annotations exists, and the description provides basic context beyond them.

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, direct sentence: 'Deletes a wiki page.' It's front-loaded with the core action and resource, with zero wasted words. This makes it highly efficient and easy for an agent to parse quickly, earning full marks for conciseness.

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

Completeness2/5

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

For a destructive tool with no output schema and multiple siblings, the description is incomplete. It lacks details on outcomes (e.g., success indicators, error conditions), usage context (e.g., permissions needed, irreversible effects), and how it fits among tools like 'undelete-page'. Given the complexity and annotation support, more guidance is needed to ensure safe and correct usage.

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 clear descriptions for both parameters: 'title' as the wiki page title and 'comment' as the reason for deletion. The description doesn't add extra meaning beyond this, such as format examples or constraints (e.g., title case-sensitivity). Given the high schema coverage, a baseline score of 3 is appropriate as the schema handles most documentation.

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

Purpose3/5

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

The description 'Deletes a wiki page' clearly states the verb (deletes) and resource (wiki page), making the purpose understandable. However, it doesn't differentiate this tool from other destructive operations like 'remove-wiki' or 'undelete-page' (which might reverse deletions), nor does it specify what constitutes a 'wiki page' in this context. It's adequate but lacks sibling differentiation.

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. It doesn't mention prerequisites (e.g., needing page existence or permissions), exclusions (e.g., not for files or categories), or related tools like 'undelete-page' for reversal. Without such context, an agent might misuse it or overlook better options.

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