logout
Clear authentication state to securely end your API session. This action removes all stored credentials.
Instructions
Logout and clear authentication state
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:403-419 (handler)The main handler for the logout tool. Checks that the REST client is configured, then delegates to restClient.logout() and returns a success message.
private async logout() { if (!this.restClient) { throw new Error( "REST client not configured. Use configure_rest_client tool or provide configuration via CLI/environment variables." ); } await this.restClient.logout(); return { content: [ { type: "text", text: "Successfully logged out", }, ], }; } - src/index.ts:208-215 (registration)Tool registration: defines the 'logout' tool with name, description, and empty inputSchema as part of the tool list.
{ name: "logout", description: "Logout and clear authentication state", inputSchema: { type: "object", properties: {}, }, }, - src/index.ts:243-244 (registration)Case handler in the CallToolRequestSchema switch statement that routes 'logout' to the this.logout() method.
case "logout": return await this.logout(); - src/rest-client.ts:233-235 (helper)RestClient.logout() method that delegates to authManager.logout() to clear authentication state.
async logout(): Promise<void> { this.authManager.logout(); } - src/auth.ts:102-104 (helper)AuthManager.logout() method that resets the authState to { isAuthenticated: false }, performing the actual state clearing.
logout(): void { this.authState = { isAuthenticated: false }; }