Skip to main content
Glama

remove-wiki

DestructiveIdempotent

Remove a wiki from MCP resources using its URI. Clears cached credentials and license metadata; requires the wiki to be inactive.

Instructions

Removes a wiki from the MCP resources. Clears any cached credentials and license metadata for the wiki. Fails if the specified wiki is currently active; call set-wiki to switch to a different wiki first.

Input Schema

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

Implementation Reference

  • The handle() function that executes the remove-wiki tool logic. Parses the wiki resource URI, validates the wiki exists and is not currently active, then removes it from the registry, invalidates caches, and triggers reconciliation.
    	async handle({ uri }, ctx: ManagementContext): Promise<CallToolResult> {
    		let wikiKey: string;
    		try {
    			({ wikiKey } = parseWikiResourceUri(uri));
    		} catch (error) {
    			if (error instanceof InvalidWikiResourceUriError) {
    				return ctx.format.invalidInput(error.message);
    			}
    			throw error;
    		}
    
    		const wikiToRemove = ctx.wikis.get(wikiKey);
    		if (!wikiToRemove) {
    			return ctx.format.invalidInput(`mcp://wikis/${wikiKey} not found in MCP resources`);
    		}
    
    		if (ctx.selection.getCurrent().key === wikiKey) {
    			return ctx.format.conflict(
    				'Cannot remove the currently active wiki. Please set a different wiki as the active wiki before removing this one.',
    			);
    		}
    
    		ctx.wikis.remove(wikiKey);
    		ctx.wikiCache.invalidate(wikiKey);
    		await ctx.reconcile();
    
    		return ctx.format.ok({
    			wikiKey,
    			sitename: wikiToRemove.sitename,
    			removed: true as const,
    		});
    	},
    };
  • Input schema for remove-wiki: requires a 'uri' string (MCP resource URI of the wiki to remove, e.g. mcp://wikis/en.wikipedia.org).
    const inputSchema = {
    	uri: z
    		.string()
    		.describe('MCP resource URI of the wiki to remove (e.g. mcp://wikis/en.wikipedia.org)'),
    } as const;
  • The removeWiki tool is imported from ./remove-wiki.js and added to the managementTools array (line 67) alongside addWiki and setWiki. It is registered in registerAllTools via dispatch with ManagementContext.
    import { removeWiki } from './remove-wiki.js';
    import { setWiki } from './set-wiki.js';
    import { oauthStatus } from './oauth-status.js';
    import { oauthLogout } from './oauth-logout.js';
    
    // `Tool<any>` widens the heterogeneous-schema array; `inputSchema: TSchema`
    // is invariant in `TSchema`, so `Tool<never>` and `Tool<ZodRawShape>` both
    // fail this assignment. The dispatcher's own generic re-narrows TSchema
    // when each tool's handler is wrapped.
    // oxlint-disable-next-line typescript/no-explicit-any
    const standardTools: Tool<any>[] = [
    	getPage,
    	getPages,
    	getPageHistory,
    	getRecentChanges,
    	searchPage,
    	searchPageByPrefix,
    	parseWikitext,
    	comparePages,
    	getFile,
    	getRevision,
    	getCategoryMembers,
    	createPage,
    	updatePage,
    	deletePage,
    	undeletePage,
    	uploadFile,
    	uploadFileFromUrl,
    	updateFile,
    	updateFileFromUrl,
    	oauthStatus,
    	oauthLogout,
    ];
    
    // oxlint-disable-next-line typescript/no-explicit-any
    const managementTools: Tool<any, ManagementContext>[] = [addWiki, removeWiki, setWiki];
  • Reconciliation gating rule: remove-wiki tool is only allowed when allowManagement is true AND there are at least 2 wikis configured (wikiCount >= 2).
    {
    	name: 'remove-wiki',
    	affects: ['remove-wiki'],
    	isAllowed: (c) => c.allowManagement && c.wikiCount >= 2,
    },
  • WikiCache interface and WikiCacheImpl implementation used by remove-wiki's handler to invalidate cached wiki state (mwn provider, license cache, extension detector) when a wiki is removed.
    export interface WikiCache {
    	/** Drops every cache entry keyed by `wikiKey`. */
    	invalidate(wikiKey: string): void;
    }
    
    export class WikiCacheImpl implements WikiCache {
    	public constructor(
    		private readonly mwnProvider: Pick<MwnProvider, 'invalidate'>,
    		private readonly licenseCache: Pick<LicenseCache, 'delete'>,
    		private readonly extensionDetector: Pick<ExtensionDetector, 'invalidate'>,
    	) {}
    
    	public invalidate(wikiKey: string): void {
    		this.mwnProvider.invalidate(wikiKey);
    		this.licenseCache.delete(wikiKey);
    		this.extensionDetector.invalidate(wikiKey);
    	}
    }
Behavior5/5

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

Description adds value beyond annotations: details about clearing cached credentials and license metadata, and the failure condition for active wikis. No contradiction with 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?

Three concise sentences with no wasted words: purpose, supplementary behavior, and usage constraint with alternative.

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

Completeness5/5

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

Given the simple parameter set and annotations covering destructiveness and idempotency, the description provides all necessary context: clearing caches, failure condition, and alternative tool.

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?

The schema already has 100% coverage for the single parameter with a clear description and example. The tool description does not add new parameter-specific meaning, so baseline 3 is appropriate.

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

Purpose5/5

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

The description clearly states the action 'Removes a wiki from the MCP resources' and distinguishes it from siblings by mentioning the active wiki constraint and referencing set-wiki.

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

Usage Guidelines5/5

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

Explicitly says when not to use (if wiki is active) and provides a clear alternative: 'call set-wiki to switch to a different wiki first.'

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