Skip to main content
Glama
CupOfOwls

Kroger MCP Server

get_location_details

Retrieve detailed information about a specific Kroger store location using its unique identifier, including store hours, services, and contact details.

Instructions

    Get detailed information about a specific Kroger store location.
    
    Args:
        location_id: The unique identifier for the store location
    
    Returns:
        Dictionary containing detailed location information
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
location_idYes

Implementation Reference

  • Implements the core logic for the get_location_details tool: fetches location data from Kroger API, formats departments and address, handles errors.
    @mcp.tool()
    async def get_location_details(
        location_id: str,
        ctx: Context = None
    ) -> Dict[str, Any]:
        """
        Get detailed information about a specific Kroger store location.
        
        Args:
            location_id: The unique identifier for the store location
        
        Returns:
            Dictionary containing detailed location information
        """
        if ctx:
            await ctx.info(f"Getting details for location {location_id}")
        
        client = get_client_credentials_client()
        
        try:
            location_details = client.location.get_location(location_id)
            
            if not location_details or "data" not in location_details:
                return {
                    "success": False,
                    "message": f"Location {location_id} not found"
                }
            
            loc = location_details["data"]
            
            # Format department information
            departments = []
            for dept in loc.get("departments", []):
                dept_info = {
                    "department_id": dept.get("departmentId"),
                    "name": dept.get("name"),
                    "phone": dept.get("phone")
                }
                
                # Add department hours
                if "hours" in dept and "monday" in dept["hours"]:
                    monday = dept["hours"]["monday"]
                    if monday.get("open24", False):
                        dept_info["hours_monday"] = "Open 24 hours"
                    elif "open" in monday and "close" in monday:
                        dept_info["hours_monday"] = f"{monday['open']} - {monday['close']}"
                
                departments.append(dept_info)
            
            # Format the response
            address = loc.get("address", {})
            result = {
                "success": True,
                "location_id": loc.get("locationId"),
                "name": loc.get("name"),
                "chain": loc.get("chain"),
                "phone": loc.get("phone"),
                "address": {
                    "street": address.get("addressLine1", ""),
                    "street2": address.get("addressLine2", ""),
                    "city": address.get("city", ""),
                    "state": address.get("state", ""),
                    "zip_code": address.get("zipCode", "")
                },
                "coordinates": loc.get("geolocation", {}),
                "departments": departments,
                "department_count": len(departments)
            }
            
            return result
            
        except Exception as e:
            if ctx:
                await ctx.error(f"Error getting location details: {str(e)}")
            return {
                "success": False,
                "error": str(e)
            }
  • Registers all location tools including get_location_details by calling the register_tools function from the location_tools module.
    location_tools.register_tools(mcp)
Behavior2/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 states it 'gets' information, implying a read-only operation, but doesn't mention authentication requirements, rate limits, error handling, or what 'detailed information' includes. This is inadequate for a tool with no annotation coverage.

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 front-loaded with the main purpose in the first sentence, followed by structured Args and Returns sections. It's efficient with minimal waste, though the Returns section could be more specific to enhance clarity without adding bulk.

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 the tool's simplicity (one parameter, no annotations, no output schema), the description is minimally adequate. It covers the basic purpose and parameter semantics but lacks details on usage context, behavioral traits, and output specifics, leaving gaps for an AI agent to infer.

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 context for the single parameter 'location_id' by explaining it's 'the unique identifier for the store location', which compensates for the 0% schema description coverage. Since there's only one parameter and the description clarifies its purpose, it earns a high score despite the low schema coverage.

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 verb 'Get' and resource 'detailed information about a specific Kroger store location', making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'get_chain_details' or 'search_locations', which reduces it from 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 such as 'search_locations' or 'get_chain_details'. It mentions a specific location but doesn't clarify prerequisites like needing a location ID or when this is preferred over other location-related tools.

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