Skip to main content
Glama

check_location_exists

Verify the existence of a specific store location in Kroger's system by providing its unique identifier. Returns a dictionary confirming the location's status.

Instructions

Check if a location exists in the Kroger system. Args: location_id: The unique identifier for the store location Returns: Dictionary indicating whether the location exists

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
location_idYes

Implementation Reference

  • The core handler function decorated with @mcp.tool(), implementing the logic to check if a Kroger store location exists using the API client. This defines the tool's input schema via type hints and docstring, and handles execution with error handling.
    @mcp.tool() async def check_location_exists( location_id: str, ctx: Context = None ) -> Dict[str, Any]: """ Check if a location exists in the Kroger system. Args: location_id: The unique identifier for the store location Returns: Dictionary indicating whether the location exists """ if ctx: await ctx.info(f"Checking if location {location_id} exists") client = get_client_credentials_client() try: exists = client.location.location_exists(location_id) return { "success": True, "location_id": location_id, "exists": exists, "message": f"Location {location_id} {'exists' if exists else 'does not exist'}" } except Exception as e: if ctx: await ctx.error(f"Error checking location existence: {str(e)}") return { "success": False, "error": str(e) }
  • The registration call in the main server setup that invokes location_tools.register_tools(mcp), thereby registering the check_location_exists tool along with other location tools on the FastMCP server instance.
    location_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