Skip to main content
Glama

clear_session

Destructive

Clear current authentication session and stored tokens to force a re-authentication when a fresh login is required.

Instructions

Clear the current authentication session and stored tokens. Use this if you need to force a re-authentication.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main tool handler for 'clear_session'. Calls client.clearSession() and configManager.clearToken(), then returns a success message.
    case 'clear_session': {
      if (client) {
        await client.clearSession();
      }
      await configManager.clearToken();
    
      return {
        content: [{
          type: 'text',
          text: 'Session cleared. You will need to re-authenticate on the next request.'
        }]
      };
    }
  • Tool schema definition for 'clear_session'. It has no input properties and is marked with destructiveHint.
    {
      name: 'clear_session',
      description: 'Clear the current authentication session and stored tokens. Use this if you need to force a re-authentication.',
      inputSchema: {
        type: 'object',
        properties: {},
        required: []
      },
      annotations: {
        destructiveHint: true
      }
    }
  • src/index.ts:228-239 (registration)
    Tool registered in the tools array with name 'clear_session'.
    {
      name: 'clear_session',
      description: 'Clear the current authentication session and stored tokens. Use this if you need to force a re-authentication.',
      inputSchema: {
        type: 'object',
        properties: {},
        required: []
      },
      annotations: {
        destructiveHint: true
      }
    }
  • clearSession() method on the client. Resets JWT token, accountId, userId, patientId, and tokenExpires, then clears token via configManager.
    /**
     * Clear stored session
     */
    async clearSession(): Promise<void> {
      this.jwtToken = null;
      this.accountId = null;
      this.userId = null;
      this.patientId = null;
      this.tokenExpires = 0;
    
      if (this.configManager) {
        await this.configManager.clearToken();
      }
    }
  • ConfigManager.clearToken() delegates to secureStorage.clearToken() to remove persisted credentials.
    async clearToken(): Promise<void> {
      await this.secureStorage.clearToken();
    }
Behavior3/5

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

The description aligns with the destructiveHint annotation by mentioning clearing the session and tokens, but does not go beyond annotations to disclose additional behavioral traits (e.g., irreversibility).

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 concise sentences front-load the action and usage, with no wasted words.

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

Completeness4/5

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

Given no output schema and low complexity, the description sufficiently covers purpose and usage without leaving critical gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, with 100% schema coverage. The description adds no parameter details but none are needed, earning a baseline of 4 for zero parameters.

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?

Clearly specifies the verb 'clear' and resource 'authentication session and stored tokens', distinguishing it from sibling tools like get_session_status or configure_credentials.

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?

States when to use the tool ('force a re-authentication'), providing clear context, though it does not explicitly mention when not to use it or alternatives.

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/sedoglia/librelink-mcp-server'

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