Skip to main content
Glama

auth_revoke

Revoke current authentication and clear tokens to securely end a FreshBooks session and protect account access.

Instructions

Revoke current authentication and clear tokens

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'auth_revoke'. Delegates to OAuth.revokeToken() and returns formatted success response.
    private async handleAuthRevoke() {
      await this.oauth.revokeToken();
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(
              {
                success: true,
                message: 'Authentication revoked successfully',
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • src/server.ts:112-119 (registration)
    Registers 'auth_revoke' tool in the MCP listTools handler with name, description, and empty input schema.
    {
      name: 'auth_revoke',
      description: 'Revoke current authentication and clear tokens',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Core revocation logic: POSTs to FreshBooks revoke endpoint using current access token (best-effort), then clears local token storage.
    async revokeToken(): Promise<void> {
      const token = await this.tokenStore.get();
    
      if (token?.accessToken) {
        try {
          // Attempt to revoke token with FreshBooks
          await fetch(FreshBooksOAuth.REVOKE_URL, {
            method: 'POST',
            headers: {
              'Content-Type': 'application/json',
              'Authorization': `Bearer ${token.accessToken}`,
            },
            body: JSON.stringify({
              token: token.accessToken,
            }),
          });
        } catch {
          // Best effort - continue to clear local storage even if revocation fails
        }
      }
    
      // Clear local token storage
      await this.tokenStore.clear();
    }

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/Good-Samaritan-Software-LLC/freshbooks-mcp'

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