Skip to main content
Glama
ProfessionalWiki

mediawiki-mcp-server

undelete-page

Destructive

Restore deleted wiki pages by providing the page title and optional restoration reason. This tool enables users to recover previously removed content on MediaWiki platforms.

Instructions

Undeletes a wiki page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesWiki page title
commentNoReason for undeleting the page

Implementation Reference

  • The handler function that executes the tool's core logic: undeletes the page using mwn.undelete, handles exceptions, and returns success or error content.
    async function handleUndeletePageTool(
    	title: string,
    	comment?: string
    ): Promise<CallToolResult> {
    	let data: ApiUndeleteResponse;
    	try {
    		const mwn = await getMwn();
    		data = await mwn.undelete( title, formatEditComment( 'undelete-page', comment ) );
    	} catch ( error ) {
    		return {
    			content: [
    				{
    					type: 'text',
    					text: `Undelete failed: ${ ( error as Error ).message }`
    				} as TextContent
    			],
    			isError: true
    		};
    	}
    
    	return {
    		content: undeletePageToolResult( data )
    	};
    }
  • Registers the 'undelete-page' tool on the MCP server, including name, description, input schema (title, optional comment), annotations, and links to the handler.
    export function undeletePageTool( server: McpServer ): RegisteredTool {
    	return server.tool(
    		'undelete-page',
    		'Undeletes a wiki page.',
    		{
    			title: z.string().describe( 'Wiki page title' ),
    			comment: z.string().optional().describe( 'Reason for undeleting the page' )
    		},
    		{
    			title: 'Undelete page',
    			readOnlyHint: false,
    			destructiveHint: true
    		} as ToolAnnotations,
    		async (
    			{ title, comment }
    		) => handleUndeletePageTool( title, comment )
    	);
    }
  • Helper function that formats the API response into the tool's output TextContent array.
    function undeletePageToolResult( data: ApiUndeleteResponse ): TextContent[] {
    	return [
    		{
    			type: 'text',
    			text: `Page undeleted successfully: ${ data.title }`
    		}
    	];
    }
  • The undeletePageTool registrar is included in the toolRegistrars array, which is used by registerAllTools to register all tools.
    undeletePageTool,
  • src/server.ts:29-29 (registration)
    Top-level call to registerAllTools(server), which triggers registration of undelete-page among other tools.
    registerAllTools( server );
Behavior3/5

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

Annotations indicate this is a destructive (destructiveHint: true) and non-read-only (readOnlyHint: false) operation, which the description doesn't explicitly state. The description adds minimal context beyond annotations by specifying it's for wiki pages, but doesn't cover potential side effects, permissions needed, or rate limits. No contradiction with annotations exists.

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 directly states the tool's function without any fluff or redundancy. It's appropriately sized and front-loaded, making it easy to parse quickly.

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?

Given the tool's complexity (a destructive operation with no output schema), the description is insufficient. It lacks details on what 'undelete' entails (e.g., restoring content, revision history), success conditions, error cases, or return values, leaving significant gaps for an agent to understand the full context.

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 wiki page title and 'comment' as reason for undeleting). The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline for high coverage without extra value.

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 ('undeletes') and resource ('a wiki page'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'delete-page' or 'update-page' beyond the obvious reversal of deletion, which keeps it from 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. It doesn't mention prerequisites (e.g., the page must be deleted first), exclusions, or relationships to siblings like 'delete-page' or 'create-page', leaving usage context entirely implicit.

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