Skip to main content
Glama
CupOfOwls

Kroger MCP Server

get_user_zip_code

Retrieve the user's zip code to enable accurate store location and product availability checks for grocery shopping with Kroger services.

Instructions

    Returns user zip code, it is anticipated that by exposing this to the LLM it will choose to use it
    rather than generating a zip code based on system data.

    Args: 
        N/A
    Returns:
        Dictionary containing user Zip Code
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_user_zip_code' tool. It retrieves the default zip code using the helper function and returns it in a dictionary.
    @mcp.tool()
    async def get_user_zip_code() -> Dict[str, Any]:
        """
        Returns user zip code, it is anticipated that by exposing this to the LLM it will choose to use it
        rather than generating a zip code based on system data.
    
        Args: 
            N/A
        Returns:
            Dictionary containing user Zip Code
        """
        zip_code = get_default_zip_code()
        # And thats literally it!
        user_zip_dict = {"user_zip_code": zip_code}
        return user_zip_dict
  • Registration of the location_tools module, which includes the get_user_zip_code tool, in the main MCP server.
    location_tools.register_tools(mcp)
  • Helper function used by the get_user_zip_code tool to obtain the default zip code from environment variables.
    def get_default_zip_code() -> str:
        """Get the default zip code from environment or fallback"""
        return get_zip_code(default="10001")
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states this is a read operation ('Returns'), but doesn't disclose any behavioral traits like authentication requirements, rate limits, error conditions, or whether this returns current/live data versus cached data. The description adds minimal behavioral context beyond the basic operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description has unnecessary meta-commentary ('it is anticipated that by exposing this to the LLM...') that doesn't help the agent understand the tool. The structure with separate 'Args' and 'Returns' sections is clear, but the first sentence could be more direct. Some sentences don't earn their place in a tool description.

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?

For a simple read tool with no parameters and no output schema, the description is minimally adequate. However, it doesn't explain what format the zip code returns in (string? integer with leading zeros?), what happens if no user is authenticated, or whether this is a live lookup versus cached data. The lack of annotations means more behavioral context would be helpful.

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 correctly states 'Args: N/A' which aligns with the empty input schema, though this is somewhat redundant since the schema already shows no parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Returns user zip code' which provides a basic verb+resource, but it's vague about what 'user' refers to (current authenticated user? any user?) and doesn't differentiate from sibling tools like 'get_user_profile' or 'get_location_details' which might also contain zip code information. The additional text about 'exposing this to the LLM' is meta-commentary rather than clarifying the tool's purpose.

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?

No guidance is provided about when to use this tool versus alternatives. The description mentions 'rather than generating a zip code based on system data' which hints at a problem this tool solves, but doesn't explicitly state when to use it versus other tools that might provide location or user data. No prerequisites, exclusions, or alternatives are mentioned.

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