Skip to main content
Glama
CupOfOwls

Kroger MCP Server

force_reauthenticate

Clear current authentication tokens to resolve login issues or switch user accounts in the Kroger MCP Server.

Instructions

    Force re-authentication by clearing the current authentication token.
    Use this if you're having authentication issues or need to log in as a different user.
    
    Returns:
        Dictionary indicating the re-authentication was initiated
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'force_reauthenticate' tool. It clears the current authentication token by calling invalidate_authenticated_client() and returns a success message instructing the user on next steps.
    @mcp.tool()
    async def force_reauthenticate(ctx: Context = None) -> Dict[str, Any]:
        """
        Force re-authentication by clearing the current authentication token.
        Use this if you're having authentication issues or need to log in as a different user.
        
        Returns:
            Dictionary indicating the re-authentication was initiated
        """
        if ctx:
            await ctx.info("Forcing re-authentication by clearing current token")
        
        try:
            # Clear the current authenticated client
            invalidate_authenticated_client()
            
            if ctx:
                await ctx.info("Authentication token cleared. Next cart operation will trigger re-authentication.")
            
            return {
                "success": True,
                "message": "Authentication token cleared. The next cart operation will open your browser for re-authentication.",
                "note": "You will need to log in again when you next use cart-related tools."
            }
            
        except Exception as e:
            if ctx:
                await ctx.error(f"Error clearing authentication: {str(e)}")
            return {
                "success": False,
                "error": str(e)
            }
  • The registration call for the profile_tools module, which includes the force_reauthenticate tool.
    profile_tools.register_tools(mcp)
  • Helper function used by force_reauthenticate to invalidate (clear) the global authenticated client reference.
    def invalidate_authenticated_client():
        """Invalidate the authenticated client to force re-authentication"""
        global _authenticated_client
        _authenticated_client = None
Behavior3/5

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

With no annotations, the description carries full burden. It discloses the action (clearing token) and outcome (re-authentication initiated), but lacks details on side effects (e.g., session termination), permissions required, or error conditions, leaving behavioral gaps.

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?

Three concise sentences: purpose, usage guidelines, and return value. Each sentence adds value with zero redundancy, and the structure is front-loaded with the core action.

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?

Given no annotations and no output schema, the description covers purpose and usage well but lacks details on behavioral implications (e.g., what 'clearing' entails, system state changes). For a security-sensitive tool, more context on effects would be beneficial.

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 with 100% schema coverage, so no parameter documentation is needed. The description appropriately omits parameter details, maintaining focus on tool purpose and usage.

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 specific action ('force re-authentication') and mechanism ('clearing the current authentication token'), distinguishing it from siblings like 'complete_authentication' or 'start_authentication' which handle different authentication phases.

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

Usage Guidelines5/5

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

Explicitly provides when to use ('if you're having authentication issues or need to log in as a different user'), offering clear context for invocation without needing to reference alternatives directly.

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

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/CupOfOwls/kroger-mcp'

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