Skip to main content
Glama
the-real-py

Bar Assistant MCP Server

by the-real-py

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

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool searches for ingredients by name to find IDs, implying a read-only operation, but doesn't cover aspects like authentication needs, rate limits, error handling, or response format. This leaves significant gaps in understanding how the tool behaves beyond its basic purpose.

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 that directly states the tool's purpose without unnecessary words. It's front-loaded and appropriately sized, making it easy for an agent to parse quickly.

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

Completeness2/5

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

Given the complexity of a search tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the output looks like (e.g., list of IDs, structured data), potential limitations (e.g., partial matches, case sensitivity), or how the optional 'bar_id' parameter affects results. This leaves the agent with insufficient context for effective use.

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?

The schema description coverage is 100%, with clear descriptions for both parameters ('name' and 'bar_id'). The description adds minimal value beyond the schema, as it only mentions searching by name without elaborating on parameter interactions or usage nuances. This meets the baseline for high schema coverage.

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 tool's purpose with a specific verb ('search') and resource ('ingredients'), explaining it finds ingredient IDs by name. However, it doesn't explicitly differentiate from sibling tools like 'get_shelf_ingredients' or 'list_bars', which might also involve ingredient-related operations.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_shelf_ingredients' for retrieving ingredients from a shelf or 'list_bars' for bar-related data, leaving the agent to infer usage context without explicit direction.

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