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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the action and return status, but does not mention consequences like whether all credentials are revoked, whether it is reversible, or whether it affects the current session. This is a destructive operation needing more transparency.

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?

The description is two short sentences, front-loaded with the purpose and including the return value. No wasted words or redundant information.

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

Completeness3/5

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

The tool is very simple (0 params, no output schema), but the description lacks context about preconditions (e.g., requiring previous auth_login) and specific side effects. It is minimally complete for the complexity, but could be more helpful by clarifying what credentials are being revoked and any irreversible effects.

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 input schema has zero properties, so no parameter documentation is needed. The baseline for 0 parameters is 4, and the description does not need to add parameter semantics.

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?

The description clearly states the action ('Revoke') and the resource ('Google Cloud credentials'), distinguishing it from sibling auth tools like auth_login and auth_list. It is specific and actionable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The usage is implied by the verb 'revoke' but there is no explicit when-to-use or alternative guidance. It doesn't mention prerequisites such as being authenticated or that this complements auth_login/auth_list. No exclusions or alternatives are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.