Skip to main content
Glama
the-real-py

Bar Assistant MCP Server

by the-real-py

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)"
            }
        }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It states the tool retrieves data ('Get'), implying it's a read operation, but doesn't mention pagination behavior, rate limits, authentication needs, or error handling. This leaves significant gaps for a tool with parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words, clearly front-loading the purpose. Every part earns its place by specifying action, resource, scope, and detail level.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and 2 parameters with full schema coverage, the description is minimally adequate. It covers the basic purpose but lacks behavioral details and usage guidance, making it incomplete for optimal agent use without additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters. The description adds no additional meaning beyond implying retrieval of 'all' ingredients, which doesn't clarify parameter usage like pagination or bar_id context. Baseline 3 is appropriate as the schema handles parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('ingredients currently on your bar shelf'), specifying scope ('all') and detail level ('detailed information'). It doesn't explicitly differentiate from sibling tools like 'search_ingredients' or 'get_shelf_cocktails', which would require a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'search_ingredients' or 'get_shelf_cocktails', nor are prerequisites or exclusions mentioned. The description implies usage for retrieving shelf ingredients but lacks explicit context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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