Skip to main content
Glama

check_department_exists

Verify the existence of a department in Kroger's system by inputting a department ID. Returns a dictionary confirming department presence.

Instructions

Check if a department exists in the Kroger system. Args: department_id: The department ID to check Returns: Dictionary indicating whether the department exists

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
department_idYes

Implementation Reference

  • The main handler function decorated with @mcp.tool(), which implements the logic to check if a Kroger department exists using the API client.
    @mcp.tool() async def check_department_exists( department_id: str, ctx: Context = None ) -> Dict[str, Any]: """ Check if a department exists in the Kroger system. Args: department_id: The department ID to check Returns: Dictionary indicating whether the department exists """ if ctx: await ctx.info(f"Checking if department '{department_id}' exists") client = get_client_credentials_client() try: exists = client.location.department_exists(department_id) return { "success": True, "department_id": department_id, "exists": exists, "message": f"Department '{department_id}' {'exists' if exists else 'does not exist'}" } except Exception as e: if ctx: await ctx.error(f"Error checking department existence: {str(e)}") return { "success": False, "error": str(e) }
  • Invocation of register_tools from info_tools module, which defines and registers the check_department_exists tool with the MCP server.
    info_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