Skip to main content
Glama

search_ingredients

Find ingredient IDs by searching with ingredient names to manage your home bar inventory and discover cocktails.

Instructions

Search for ingredients by name to find their IDs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesIngredient name to search for
bar_idNoBar ID (optional if BAR_ASSISTANT_BAR_ID is set)

Implementation Reference

  • Handler for the search_ingredients tool: queries the ingredients API endpoint with a name filter, formats and returns the list of matching ingredients or a no-results message.
    elif name == "search_ingredients": bar_id = arguments.get("bar_id") or CONFIG["bar_id"] response = await client.get( f"{CONFIG['api_url']}/ingredients", headers=get_headers(bar_id), params={"filter[name]": arguments["name"]} ) response.raise_for_status() data = response.json() if not data.get('data'): return [TextContent(type="text", text="No ingredients found matching your search.")] result = "Found ingredients:\n\n" for ing in data.get('data', []): result += f"- **{ing['name']}** (ID: {ing['id']})\n" if ing.get('description'): result += f" {ing['description'][:100]}...\n" return [TextContent(type="text", text=result)]
  • Input schema definition for the search_ingredients tool, specifying the required 'name' parameter and optional 'bar_id'.
    inputSchema={ "type": "object", "properties": { "name": { "type": "string", "description": "Ingredient name to search for" }, "bar_id": { "type": "number", "description": "Bar ID (optional if BAR_ASSISTANT_BAR_ID is set)" } }, "required": ["name"] }
  • Registration of the search_ingredients tool in the MCP app's tools list, including name, description, and input schema.
    Tool( name="search_ingredients", description="Search for ingredients by name to find their IDs", inputSchema={ "type": "object", "properties": { "name": { "type": "string", "description": "Ingredient name to search for" }, "bar_id": { "type": "number", "description": "Bar ID (optional if BAR_ASSISTANT_BAR_ID is set)" } }, "required": ["name"] } )

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/the-real-py/bar-assistant-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server