Skip to main content
Glama
CupOfOwls

Kroger MCP Server

get_authentication_info

Retrieve authentication status and token details for accessing Kroger's grocery shopping features through the MCP server.

Instructions

    Get information about the current authentication state and token.
    
    Returns:
        Dictionary containing authentication information
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main execution logic for the 'get_authentication_info' tool. This async function retrieves the authenticated Kroger client, extracts token information (type, expiration, scope, previews without full tokens for security), token file path, and returns a structured dictionary with authentication status.
    @mcp.tool()
    async def get_authentication_info(ctx: Context = None) -> Dict[str, Any]:
        """
        Get information about the current authentication state and token.
        
        Returns:
            Dictionary containing authentication information
        """
        if ctx:
            await ctx.info("Getting authentication information")
        
        try:
            client = get_authenticated_client()
            
            result = {
                "success": True,
                "authenticated": True,
                "message": "User is authenticated"
            }
            
            # Get token information if available
            if hasattr(client.client, 'token_info') and client.client.token_info:
                token_info = client.client.token_info
                
                result.update({
                    "token_type": token_info.get("token_type", "Unknown"),
                    "has_refresh_token": "refresh_token" in token_info,
                    "expires_in": token_info.get("expires_in"),
                    "scope": token_info.get("scope", "Unknown")
                })
                
                # Don't expose the actual tokens for security
                result["access_token_preview"] = f"{token_info.get('access_token', '')[:10]}..." if token_info.get('access_token') else "N/A"
                
                if "refresh_token" in token_info:
                    result["refresh_token_preview"] = f"{token_info['refresh_token'][:10]}..."
            
            # Get token file information if available
            if hasattr(client.client, 'token_file') and client.client.token_file:
                result["token_file"] = client.client.token_file
            
            return result
            
        except Exception as e:
            if ctx:
                await ctx.error(f"Error getting authentication info: {str(e)}")
            return {
                "success": False,
                "error": str(e),
                "authenticated": False
            }
  • Invocation of profile_tools.register_tools(mcp) in the server creation function, which defines and registers the get_authentication_info tool (along with other profile tools) by applying the @mcp.tool() decorator.
    profile_tools.register_tools(mcp)
  • Import of the profile_tools module containing the get_authentication_info tool definition and registration logic.
    from .tools import profile_tools
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 that the tool returns a dictionary with authentication information, without detailing what specific fields are included (e.g., token expiry, user ID, permissions), whether it requires authentication to call, or if it has side effects like refreshing tokens. This leaves significant gaps in understanding the tool's behavior.

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 in the first sentence and a concise note on the return value. There's no unnecessary fluff, and both sentences add value. However, the structure could be slightly improved by integrating the return information more seamlessly, but it remains efficient overall.

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 complexity of authentication tools and the lack of annotations and output schema, the description is incomplete. It doesn't explain what specific authentication information is returned, how it differs from other authentication tools, or any prerequisites for use. For a tool that likely involves sensitive state, more context is needed to guide the agent effectively.

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 zero parameters, and the input schema has 100% description coverage (though empty). The description appropriately doesn't waste space discussing parameters, which aligns with the schema. A baseline of 4 is applied since no parameters exist, and the description doesn't need to compensate for any gaps.

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: 'Get information about the current authentication state and token.' It uses a specific verb ('Get') and identifies the resource ('authentication state and token'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling authentication tools like 'test_authentication' or 'complete_authentication', which prevents a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'test_authentication', 'start_authentication', and 'complete_authentication', there's no indication of whether this tool is for checking token validity, retrieving metadata, or other specific contexts. The lack of usage context leaves the agent guessing about appropriate scenarios.

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