Skip to main content
Glama

oauth-logout

DestructiveIdempotent

Remove stored OAuth tokens to log out from MediaWiki wikis. Omit the wiki key to log out from all wikis.

Instructions

Removes stored OAuth tokens. With no argument, removes all stored tokens; with wiki, removes only that wiki. Stdio only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wikiNoWiki key to log out from. Omit to log out from all wikis.

Implementation Reference

  • The handle() function that executes the oauth-logout tool logic. Reads the token store, identifies target wiki(s), deletes tokens, and returns the list of removed keys. Guards against non-stdio transport.
    	async handle({ wiki }, ctx: ToolContext): Promise<CallToolResult> {
    		// Defense in depth: the reconcile rule already hides this tool on HTTP,
    		// but a forced direct invocation must not delete from the local credentials file.
    		if (ctx.transport !== 'stdio') {
    			return ctx.format.invalidInput('oauth-logout is only available on the stdio transport.');
    		}
    		const store = createTokenStore();
    		const cur = await store.read();
    		const targets = typeof wiki === 'string' ? [wiki] : Object.keys(cur.tokens);
    		const removed: string[] = [];
    		for (const key of targets) {
    			if (cur.tokens[key]) {
    				await store.delete(key);
    				removed.push(key);
    				ctx.logger.info('', { event: 'oauth_token_revoked', wiki: key });
    			}
    		}
    		return ctx.format.ok({ removed });
    	},
    };
  • Input schema for oauth-logout: an optional 'wiki' string parameter. If omitted, logs out from all wikis.
    const inputSchema = {
    	wiki: z.string().optional().describe('Wiki key to log out from. Omit to log out from all wikis.'),
    } as const;
  • Import of oauthLogout from ./oauth-logout.js.
    import { oauthLogout } from './oauth-logout.js';
  • oauthLogout is included in the standardTools array, which is registered via register() in registerAllTools.
    oauthStatus,
    oauthLogout,
  • oauth-logout is listed in TOOLS_BYPASSING_ACTIVE_WIKI_AUTH, meaning it skips OAuth token acquisition for the active wiki.
    const TOOLS_BYPASSING_ACTIVE_WIKI_AUTH: ReadonlySet<string> = new Set([
    	'add-wiki',
    	'set-wiki',
    	'remove-wiki',
    	'oauth-status',
    	'oauth-logout',
    ]);
Behavior4/5

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

Adds value beyond annotations by describing token removal behavior and constraint. Annotations already indicate destructive and idempotent, so consistent.

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?

Two sentences, no filler, front-loaded with key action and behavior split.

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?

For a simple tool with one optional parameter and no output schema, the description fully covers purpose, behavior, and constraints.

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 coverage is 100% and schema description already explains the wiki parameter. The description reiterates the same info, adding no new semantics beyond the schema.

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?

Description clearly states verb 'Removes' and resource 'stored OAuth tokens', with specific behavior for with/without argument. Differentiates from siblings like oauth-status.

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

Usage Guidelines4/5

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

Provides usage constraint 'Stdio only' and implies when to use (to remove tokens), but does not explicitly mention alternatives or when-not to use.

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