Skip to main content
Glama

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)

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