Skip to main content
Glama

get_shelf_cocktails

Find cocktails you can make with ingredients currently available on your bar shelf. Use this tool to discover drink recipes based on what you have in stock.

Instructions

Get all cocktails you can make with ingredients on your bar shelf

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bar_idNoBar ID (optional if BAR_ASSISTANT_BAR_ID is set)
pageNoPage number for pagination (optional)

Implementation Reference

  • Handler implementation for the 'get_shelf_cocktails' tool. Fetches cocktails makeable with bar shelf ingredients from the API, handles pagination and bar_id, formats the response as text.
    elif name == "get_shelf_cocktails": 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." )] params = {} if arguments.get("page"): params["page"] = arguments["page"] response = await client.get( f"{CONFIG['api_url']}/bars/{int(bar_id)}/cocktails", headers=get_headers(bar_id), params=params ) response.raise_for_status() data = response.json() result = f"You can make {len(data.get('data', []))} cocktails:\n\n" for cocktail in data.get('data', []): result += f"**{cocktail['name']}** (ID: {cocktail['id']})\n" if cocktail.get('short_ingredients'): result += f" • {', '.join(cocktail['short_ingredients'])}\n" return [TextContent(type="text", text=result)]
  • Registration of the 'get_shelf_cocktails' tool in list_tools(), including its name, description, and input schema.
    Tool( name="get_shelf_cocktails", description="Get all cocktails you can make with ingredients on your bar shelf", inputSchema={ "type": "object", "properties": { "bar_id": { "type": "number", "description": "Bar ID (optional if BAR_ASSISTANT_BAR_ID is set)" }, "page": { "type": "number", "description": "Page number for pagination (optional)" } } } ),

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