Skip to main content
Glama
CupOfOwls

Kroger MCP Server

clear_current_cart

Clears local cart tracking data after items are removed from the actual Kroger cart through the app or website, ensuring synchronization between local tracking and the user's real cart.

Instructions

    Clear all items from the local cart tracking only.
    
    IMPORTANT: This tool CANNOT remove items from the actual Kroger cart in the app/website.
    It only clears our local tracking. The user must remove items from their actual cart
    through the Kroger app or website themselves.
    
    Use this tool only when:
    1. The user has already cleared their Kroger cart through the app/website
    2. You need to update the local tracking to reflect that change
    3. Or when the local tracking is out of sync with the actual cart
    
    Returns:
        Dictionary confirming the local cart tracking was cleared
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async handler function implementing the clear_current_cart MCP tool. Clears the local cart JSON file by emptying the current_cart array, updating the last_updated timestamp, and returning a confirmation with the count of cleared items. Note that this only affects local tracking, not the actual Kroger cart.
    async def clear_current_cart(ctx: Context = None) -> Dict[str, Any]:
        """
        Clear all items from the local cart tracking only.
        
        IMPORTANT: This tool CANNOT remove items from the actual Kroger cart in the app/website.
        It only clears our local tracking. The user must remove items from their actual cart
        through the Kroger app or website themselves.
        
        Use this tool only when:
        1. The user has already cleared their Kroger cart through the app/website
        2. You need to update the local tracking to reflect that change
        3. Or when the local tracking is out of sync with the actual cart
        
        Returns:
            Dictionary confirming the local cart tracking was cleared
        """
        try:
            cart_data = _load_cart_data()
            items_count = len(cart_data.get("current_cart", []))
            
            cart_data["current_cart"] = []
            cart_data["last_updated"] = datetime.now().isoformat()
            _save_cart_data(cart_data)
            
            return {
                "success": True,
                "message": f"Cleared {items_count} items from local cart tracking",
                "items_cleared": items_count
            }
        except Exception as e:
            return {
                "success": False,
                "error": f"Failed to clear cart: {str(e)}"
            }
  • Registration block in the main server where cart_tools.register_tools(mcp) is called. This invokes the registration of all cart tools, including clear_current_cart.
    location_tools.register_tools(mcp)
    product_tools.register_tools(mcp)
    cart_tools.register_tools(mcp)
    info_tools.register_tools(mcp)
    profile_tools.register_tools(mcp)
    utility_tools.register_tools(mcp)
    auth_tools.register_tools(mcp)
Behavior4/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 clearly explains this is a local-only operation with no effect on the actual Kroger cart, which is crucial context. It also describes the return value (dictionary confirmation), though it doesn't detail potential errors or side effects beyond the clearing action.

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 well-structured with clear sections: purpose statement, important limitation, usage guidelines, and return value. Every sentence adds value - the warning about actual cart limitations is critical, and the numbered usage scenarios are efficiently presented. No wasted words.

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

Completeness5/5

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

For a zero-parameter tool with no annotations and no output schema, the description provides complete context. It explains what the tool does, what it doesn't do, when to use it, and what it returns. The limitation about actual cart operations is particularly important given sibling tools that interact with carts.

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 description coverage, so the baseline is 4. The description appropriately doesn't discuss parameters since none exist, maintaining focus on the tool's purpose and usage context without unnecessary repetition.

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 ('Clear all items') and resource ('local cart tracking only'), distinguishing it from sibling tools like 'remove_from_cart' which likely interacts with the actual cart. It explicitly differentiates from actual cart operations, making the purpose unambiguous.

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?

The description provides explicit when-to-use guidance with three numbered scenarios (e.g., after user clears actual cart, to update local tracking, or when out of sync). It also clearly states when NOT to use it (cannot remove items from actual Kroger cart), offering clear alternatives (user must use app/website).

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