Skip to main content
Glama

auth_revoke

Revoke Google Cloud credentials using GCP MCP to manage access securely. Returns a status message confirming successful credential revocation.

Instructions

    Revoke Google Cloud credentials.
    
    Returns:
        Status message indicating whether the credentials were revoked
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'auth_revoke' tool. It attempts to revoke active Google Cloud credentials using google.auth and removes the application default credentials (ADC) file.
    def auth_revoke() -> str:
        """
        Revoke Google Cloud credentials.
        
        Returns:
            Status message indicating whether the credentials were revoked
        """
        try:
            import google.auth
            from google.auth.transport.requests import Request
            
            # Check if we have application default credentials
            try:
                credentials, _ = google.auth.default()
                
                # If credentials have a revoke method, use it
                if hasattr(credentials, 'revoke'):
                    credentials.revoke(Request())
                
                # Remove the application default credentials file
                adc_path = _get_adc_path()
                if os.path.exists(adc_path):
                    os.remove(adc_path)
                    return "Application default credentials have been revoked and removed."
                else:
                    return "No application default credentials file found to remove."
            
            except Exception as e:
                return f"No active credentials found or failed to revoke: {str(e)}"
                
        except Exception as e:
            return f"Error revoking credentials: {str(e)}"
  • Registers all authentication tools, including 'auth_revoke', with the MCP server by calling the auth module's register_tools function.
    auth_tools.register_tools(mcp)
  • Helper function used by auth_revoke to determine the path to the application default credentials file for removal.
    def _get_adc_path() -> str:
        """Get the path to the application default credentials file."""
        # Standard ADC paths by platform
        if os.name == 'nt':  # Windows
            return os.path.join(os.environ.get('APPDATA', ''), 'gcloud', 'application_default_credentials.json')
        else:  # Linux/Mac
            return os.path.expanduser('~/.config/gcloud/application_default_credentials.json')
  • Imports the auth tools module, enabling registration of auth_revoke tool.
    from .gcp_modules.auth import tools as auth_tools
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the action ('Revoke') and a generic return ('Status message'), but lacks critical details such as authentication requirements, whether this affects all credentials or specific ones, potential side effects, 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief and front-loaded, with the core purpose stated first and a return value note added efficiently. However, the return statement could be integrated more seamlessly, and some redundancy exists (e.g., 'credentials' repeated).

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

Completeness2/5

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

Given the tool's complexity (a mutation operation with security implications), no annotations, and no output schema, the description is insufficient. It misses details like what 'revoke' entails, authentication needs, or error handling, making it incomplete for safe agent use.

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?

The tool has 0 parameters, and schema description coverage is 100%, so no parameter information is needed. The description appropriately doesn't discuss parameters, earning a baseline score of 4 for not adding unnecessary details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Revoke') and resource ('Google Cloud credentials'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'auth_list' or 'auth_login', which would require a 5.

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 is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing active credentials to revoke), exclusions, or related tools like 'auth_login' for context, leaving usage unclear.

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

Related 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/henihaddad/gcp-mcp'

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