Skip to main content
Glama

auth_logout

Terminate the current authenticated session to log out from Magento.

Instructions

Destroy the current session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsNoAction parameters as a JSON object

Implementation Reference

  • The `auth.logout` action handler — calls `sessionStore.destroy(context.sessionId)` to destroy the current session and returns a success or 'No active session' message.
    {
      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',
        };
      },
  • The `SessionStore.destroy()` method — deletes the session from the in-memory Map and returns a boolean indicating whether it existed.
    destroy(sessionId: string): boolean {
      return this.sessions.delete(sessionId);
    }
  • src/index.ts:51-61 (registration)
    The tool registration in `src/index.ts`: `createAuthActions(sessionStore)` is spread into the `allActions` array, and then each action is registered as an MCP tool via `mcpServer.tool(toolName, ...)` where `auth.logout` becomes `auth_logout`.
    const allActions: ActionDefinition[] = [
      ...createAuthActions(sessionStore),
      ...createScopeActions(sessionStore),
      ...createPromotionsActions(planStore, guardrails, config),
      ...createCatalogActions(planStore, guardrails, idempotencyLedger, config),
      ...createPricingActions(planStore, guardrails, idempotencyLedger, config),
      ...createCmsActions(planStore, guardrails, config),
      ...createSeoActions(planStore, guardrails, config),
      ...createDiagnosticsActions(),
      ...createCacheActions(guardrails, config),
    ];
Behavior2/5

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

No annotations provided; description only says 'destroy the current session' without detailing side effects, token invalidation, or error conditions.

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?

Single sentence, no wasted words, perfectly concise.

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

Completeness3/5

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

Adequate for a simple logout action, but lacks behavioral details like session invalidation confirmation; no output schema provided.

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% (single param 'params' has a description), so baseline is 3. Tool description adds no additional meaning beyond the vague schema description.

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 'destroy' and resource 'current session', distinguishing it from sibling tools like auth_login and auth_whoami.

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?

No guidance on when to use this tool versus alternatives; no mention of prerequisites or post-conditions.

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

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