Skip to main content
Glama

remove-wiki

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; }

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