Skip to main content
Glama

add_ingredients_to_shelf

Add ingredients to your bar shelf by their IDs to manage your home bar inventory and discover cocktails you can make.

Instructions

Add ingredients to your bar shelf by their IDs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ingredient_idsYesArray of ingredient IDs to add to shelf
bar_idNoBar ID (optional if BAR_ASSISTANT_BAR_ID is set)

Implementation Reference

  • The execution logic for the 'add_ingredients_to_shelf' tool. Extracts bar_id and ingredient_ids, sends a POST request to batch-add ingredients to the bar shelf via the API, and returns a success message.
    elif name == "add_ingredients_to_shelf": bar_id = arguments.get("bar_id") or CONFIG["bar_id"] if not bar_id: return [TextContent( type="text", text="Error: No bar ID provided. Use list_bars to find your bar ID or set BAR_ASSISTANT_BAR_ID." )] ingredient_ids = [int(id) for id in arguments["ingredient_ids"]] response = await client.post( f"{CONFIG['api_url']}/bars/{int(bar_id)}/ingredients/batch-store", headers=get_headers(bar_id), json={"ingredients": ingredient_ids} ) response.raise_for_status() return [TextContent( type="text", text=f"Successfully added {len(ingredient_ids)} ingredients to your bar shelf!" )]
  • Registration of the 'add_ingredients_to_shelf' tool in the list_tools() function, including its name, description, and input schema definition.
    Tool( name="add_ingredients_to_shelf", description="Add ingredients to your bar shelf by their IDs", inputSchema={ "type": "object", "properties": { "ingredient_ids": { "type": "array", "items": {"type": "number"}, "description": "Array of ingredient IDs to add to shelf" }, "bar_id": { "type": "number", "description": "Bar ID (optional if BAR_ASSISTANT_BAR_ID is set)" } }, "required": ["ingredient_ids"] } ),
  • Input schema for the 'add_ingredients_to_shelf' tool, defining required ingredient_ids array and optional bar_id.
    inputSchema={ "type": "object", "properties": { "ingredient_ids": { "type": "array", "items": {"type": "number"}, "description": "Array of ingredient IDs to add to shelf" }, "bar_id": { "type": "number", "description": "Bar ID (optional if BAR_ASSISTANT_BAR_ID is set)" } }, "required": ["ingredient_ids"] } ),

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