Skip to main content
Glama
CupOfOwls

Kroger MCP Server

view_order_history

View previously placed grocery orders from the Kroger MCP Server to track purchases and reference past transactions.

Instructions

    View the history of placed orders.
    
    Note: This tool can only see orders that were explicitly marked as placed via this MCP server.
    The Kroger API does not provide permission to query the actual order history from Kroger's systems.
    
    Args:
        limit: Number of recent orders to show (1-50)
    
    Returns:
        Dictionary containing order history
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Implementation Reference

  • The main handler function for the 'view_order_history' tool. Loads order history from local JSON file, sorts recent orders first, limits results, computes summary stats, and returns structured data. Includes input validation for limit (1-50). Uses helper functions like _load_order_history.
    @mcp.tool()
    async def view_order_history(
        limit: int = 10,
        ctx: Context = None
    ) -> Dict[str, Any]:
        """
        View the history of placed orders.
        
        Note: This tool can only see orders that were explicitly marked as placed via this MCP server.
        The Kroger API does not provide permission to query the actual order history from Kroger's systems.
        
        Args:
            limit: Number of recent orders to show (1-50)
        
        Returns:
            Dictionary containing order history
        """
        try:
            # Ensure limit is within bounds
            limit = max(1, min(50, limit))
            
            order_history = _load_order_history()
            
            # Sort by placed_at date (most recent first) and limit
            sorted_orders = sorted(order_history, key=lambda x: x.get("placed_at", ""), reverse=True)
            limited_orders = sorted_orders[:limit]
            
            # Calculate summary stats
            total_orders = len(order_history)
            total_items_all_time = sum(order.get("item_count", 0) for order in order_history)
            total_quantity_all_time = sum(order.get("total_quantity", 0) for order in order_history)
            
            return {
                "success": True,
                "orders": limited_orders,
                "showing": len(limited_orders),
                "summary": {
                    "total_orders": total_orders,
                    "total_items_all_time": total_items_all_time,
                    "total_quantity_all_time": total_quantity_all_time
                }
            }
        except Exception as e:
            return {
                "success": False,
                "error": f"Failed to view order history: {str(e)}"
            }
  • Registration block in the main server file where cart_tools.register_tools(mcp) is called (line 74), which in turn defines and registers the view_order_history tool via @mcp.tool() decorator.
    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 effectively adds context: it reveals a critical limitation (only sees server-marked orders, not Kroger API data), which is essential for understanding the tool's behavior. However, it doesn't cover other potential traits like error handling, response format details, or performance aspects, leaving some 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?

The description is appropriately sized and front-loaded. The first sentence states the purpose clearly, followed by critical notes and parameter/return details in a structured format. Every sentence adds value: the note explains limitations, and the Args/Returns sections provide necessary details without redundancy. No wasted words.

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

Completeness4/5

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

Given the tool's moderate complexity (1 parameter, no output schema, no annotations), the description is mostly complete. It covers purpose, limitations, parameter semantics, and return type. However, without an output schema, it could benefit from more details on the return structure (e.g., what fields are in the dictionary), but the note on limitations mitigates this gap adequately.

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 description adds meaningful semantics beyond the input schema. The schema has 0% description coverage for the single parameter 'limit,' but the description specifies: 'Number of recent orders to show (1-50).' This clarifies the parameter's purpose, range, and ordering ('recent'), compensating well for the low schema coverage. It doesn't explain default behavior, but the schema provides a default value.

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: 'View the history of placed orders.' It specifies the verb ('view') and resource ('history of placed orders'), making the action explicit. However, it doesn't explicitly differentiate from sibling tools like 'view_current_cart' or 'mark_order_placed' beyond the scope of 'placed orders,' which slightly limits its distinction.

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 usage guidance: 'This tool can only see orders that were explicitly marked as placed via this MCP server. The Kroger API does not provide permission to query the actual order history from Kroger's systems.' This clearly states when to use it (for server-marked orders) and when not to use it (for actual Kroger API history), with an implied alternative being external systems. No misleading information is present.

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