Skip to main content
Glama

get_shelf_ingredients

Retrieve all ingredients currently available on your bar shelf with detailed information for inventory management and cocktail preparation.

Instructions

Get all ingredients currently on your bar shelf with detailed information

Input Schema

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

Implementation Reference

  • Handler logic for the 'get_shelf_ingredients' tool. Fetches ingredients on the bar shelf from the API, handles pagination and bar_id, formats the response as text listing ingredients.
    if name == "get_shelf_ingredients": 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 = {"filter[bar_shelf]": "true"} if arguments.get("page"): params["page"] = arguments["page"] response = await client.get( f"{CONFIG['api_url']}/ingredients", headers=get_headers(bar_id), params=params ) response.raise_for_status() data = response.json() return [TextContent( type="text", text=f"Found {len(data.get('data', []))} ingredients on your bar shelf:\n\n" + "\n".join([f"- {ing['name']} (ID: {ing['id']})" for ing in data.get('data', [])]) )]
  • Tool registration in list_tools() function, defining the name, description, and input schema for 'get_shelf_ingredients'.
    Tool( name="get_shelf_ingredients", description="Get all ingredients currently on your bar shelf with detailed information", 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)" } } } ),
  • Input schema definition for the 'get_shelf_ingredients' tool, specifying optional bar_id and page parameters.
    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