Skip to main content
Glama

auth_logout

End the current user session to log out from the Magento MCP Server. This action destroys session data for secure account management.

Instructions

Destroy the current session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsNoAction parameters as a JSON object

Implementation Reference

  • The handler function for auth.logout that destroys the session by calling sessionStore.destroy() and returns a success message or 'No active session' if no session existed.
    handler: async (_params: Record<string, unknown>, context: ActionContext) => {
      const destroyed = sessionStore.destroy(context.sessionId);
      return {
        message: destroyed ? 'Logged out successfully' : 'No active session',
      };
    },
  • Tool registration defining auth.logout with name, description ('Destroy the current session.'), risk tier (Safe), and requiresAuth flag (true). The handler is the async function that executes the logout logic.
    {
      name: 'auth.logout',
      description: 'Destroy the current session.',
      riskTier: RiskTier.Safe,
      requiresAuth: true,
      handler: async (_params: Record<string, unknown>, context: ActionContext) => {
        const destroyed = sessionStore.destroy(context.sessionId);
        return {
          message: destroyed ? 'Logged out successfully' : 'No active session',
        };
      },
    },
  • src/index.ts:76-78 (registration)
    MCP tool registration where action.name 'auth.logout' is converted to 'auth_logout' by replacing dots with underscores, making it the tool name exposed via MCP protocol.
    for (const action of allActions) {
      // Convert dots to underscores for MCP tool names (e.g. "auth.login" -> "auth_login")
      const toolName = action.name.replace(/\./g, '_');
  • The SessionStore.destroy() method that removes the session from the in-memory Map, returning true if the session existed and was deleted, false otherwise.
    destroy(sessionId: string): boolean {
      return this.sessions.delete(sessionId);
    }

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/thomastx05/magento-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server