Skip to main content
Glama

diagnose_google_auth

Diagnose active Google authentication configurations to verify setup and identify issues for Google Workspace integrations.

Instructions

Return a quick summary of the active Google authentication setup.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main tool handler decorated with @mcp.tool() that executes the diagnose_google_auth tool. It calls get_client().auth_summary() to retrieve authentication status information.
    @mcp.tool()
    def diagnose_google_auth() -> dict[str, Any]:
        """Return a quick summary of the active Google authentication setup."""
        return get_client().auth_summary()
  • The auth_summary() method in GoogleWorkspaceClient that performs the actual work. It builds and returns a comprehensive dictionary with authentication configuration details including API keys, OAuth client status, service account status, token scopes, and recommendations.
    def auth_summary(self) -> dict[str, Any]:
        oauth_client_ready = bool(self.oauth_client_secrets_file or self.oauth_client_config_json)
        oauth_client_source = None
        if self.oauth_client_secrets_file:
            oauth_client_source = str(self.oauth_client_secrets_file)
        elif self.oauth_client_config_json:
            oauth_client_source = "GOOGLE_OAUTH_CLIENT_CONFIG_JSON"
        service_account_ready = bool(self.service_account_file or self.service_account_json)
        service_account_source = None
        if self.service_account_file:
            service_account_source = str(self.service_account_file)
        elif self.service_account_json:
            service_account_source = "GOOGLE_SERVICE_ACCOUNT_JSON"
        cached_oauth_scopes = self._cached_oauth_token_scopes()
        return {
            "api_key_configured": bool(self.api_key),
            "oauth_access_token_configured": bool(self.oauth_access_token),
            "oauth_client_configured": oauth_client_ready,
            "oauth_client_source": oauth_client_source,
            "oauth_token_file": str(self.oauth_token_file),
            "oauth_token_cached": self.oauth_token_file.exists(),
            "oauth_token_format": self._cached_oauth_token_format(),
            "oauth_token_scopes": cached_oauth_scopes,
            "oauth_token_missing_scopes": self._missing_cached_oauth_scopes(DEFAULT_READONLY_SCOPES),
            "service_account_configured": service_account_ready,
            "service_account_source": service_account_source,
            "recommended_mode": self._recommended_mode(),
            "active_auth_mode": self._active_auth_mode(),
            "notes": [
                "Public Sheets can be read with GOOGLE_API_KEY.",
                "OAuth desktop client credentials can read private files shared to your Google account.",
                "Docs API and Drive export are most reliable with a service account or OAuth access token.",
                "A service account must be granted access to private files or shared drives.",
            ],
        }
  • Import statement that brings the diagnose_google_auth function from the tools module into the package namespace for registration.
    from .tools import (
        diagnose_google_auth,
  • Export of diagnose_google_auth in the __all__ list, making it available as part of the public API.
    "diagnose_google_auth",

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/NgoQuocViet2001/google-workspace-mcp'

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