get_ingredient_info
Retrieve detailed information about cocktail ingredients including descriptions, usage in recipes, substitution options, and flavor profiles to support ingredient research and cocktail creation.
Instructions
Get comprehensive information about cocktail ingredients and their usage.
Use Cases:
Ingredient research: "what is Aperol?", "tell me about gin"
Substitution guidance: finding alternatives for unavailable ingredients
Usage exploration: see how ingredients are used across different cocktails
Flavor profile understanding: learn about ingredient characteristics
Response Format: Returns detailed ingredient information including:
Ingredient description and characteristics
List of cocktails using this ingredient (with complete recipes)
Suggested substitutions with flavor impact notes
Common flavor profiles and tasting notes
Direct links to featured cocktails
Examples:
{ingredient_name: "Campari"} → Campari info + Negroni, Boulevardier recipes
{ingredient_name: "rye whiskey"} → Usage in Manhattan, Sazerac, etc.
{ingredient_name: "elderflower liqueur"} → Aviation, Paper Plane recipes
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ingredient_name | Yes | The name of the ingredient to get information about |
Implementation Reference
- Executes the get_ingredient_info tool: searches cocktails by ingredient name, fetches complete recipes with highlighting, provides hardcoded substitutions based on ingredient (gin/vermouth/campari), returns structured IngredientInfoResponse with human-readable markdown.private async handleGetIngredientInfo(args: { ingredient_name: string }) { const startTime = Date.now(); try { // Search for cocktails that use this ingredient const cocktailsWithIngredient = await this.barClient.searchCocktails({ ingredient: args.ingredient_name, limit: 10, }); let response = `# ${args.ingredient_name} Information\n\n`; const cocktailUsage: ResponseSchemas.IngredientUsage[] = []; if (cocktailsWithIngredient.data.length > 0) { response += `## Popular Cocktails Using ${args.ingredient_name}\n\n`; response += `Here are complete recipes for cocktails featuring **${args.ingredient_name}**:\n\n`; // Fetch complete recipes for all cocktails const completeRecipes = await this.fetchCompleteRecipes(cocktailsWithIngredient.data); // Add to structured data for all cocktails completeRecipes.forEach(cocktail => { cocktailUsage.push({ cocktail, usage_notes: `Used in ${cocktail.name}` }); }); // Use standardized multi-cocktail formatter with ingredient highlighting response += this.formatMultipleCocktails(completeRecipes, args.ingredient_name); } else { response += `## Usage\n\nNo cocktails found using "${args.ingredient_name}" in the current database.\n\n`; } // Add substitution suggestions with structured data const substitutions: ResponseSchemas.SubstitutionSuggestion[] = []; const lowerName = args.ingredient_name.toLowerCase(); if (lowerName.includes('gin')) { response += `## Common Substitutes\n• **Vodka** (for a cleaner flavor)\n• **White rum** (for tropical drinks)\n• **Aquavit** (for herbal complexity)\n\n`; substitutions.push( { substitute: 'Vodka', description: 'Provides a cleaner, neutral flavor profile', flavor_impact: 'Less botanical, more neutral' }, { substitute: 'White rum', description: 'Adds tropical character to cocktails', flavor_impact: 'Sweeter, more tropical' }, { substitute: 'Aquavit', description: 'Maintains herbal complexity', flavor_impact: 'Different botanicals, caraway notes' } ); } else if (lowerName.includes('vermouth')) { response += `## Common Substitutes\n• **Lillet Blanc** (lighter, more citrusy)\n• **Cocchi Americano** (more bitter)\n• **Dry sherry** (for fortified wine character)\n\n`; substitutions.push( { substitute: 'Lillet Blanc', description: 'Lighter and more citrus-forward', flavor_impact: 'Less herbal, more citrusy' }, { substitute: 'Cocchi Americano', description: 'More bitter and complex', flavor_impact: 'More bitter, quinine notes' }, { substitute: 'Dry sherry', description: 'Provides fortified wine character', flavor_impact: 'Nuttier, more oxidized flavors' } ); } else if (lowerName.includes('campari')) { response += `## Common Substitutes\n• **Aperol** (lighter, sweeter)\n• **Cappelletti** (similar bitterness)\n• **Gran Classico** (spicier profile)\n\n`; substitutions.push( { substitute: 'Aperol', description: 'Lighter and sweeter alternative', flavor_impact: 'Less bitter, more orange-forward' }, { substitute: 'Cappelletti', description: 'Similar bitterness profile', flavor_impact: 'Similar bitterness, different herbal notes' }, { substitute: 'Gran Classico', description: 'Spicier and more complex', flavor_impact: 'More spice, different bitter profile' } ); } response += `*All recipes above show exactly how **${args.ingredient_name}** is used in each cocktail.*`; // Create structured response const structuredData: ResponseSchemas.IngredientInfoResponse = { ingredient: args.ingredient_name, description: `Information about ${args.ingredient_name} and cocktails that use it`, cocktail_usage: cocktailUsage, substitutions: substitutions.length > 0 ? substitutions : undefined, query: { ingredient_name: args.ingredient_name }, metadata: this.createResponseMetadata('bar_assistant_api', cocktailUsage.length, startTime) }; return this.createStructuredResponse(response, structuredData); } catch (error) { console.error('Error getting ingredient info:', error); return { content: [ { type: 'text', text: `# Error Getting Ingredient Information\n\n` + `Sorry, I encountered an error while looking up information for "${args.ingredient_name}".\n\n` + `**Error:** ${error instanceof Error ? error.message : String(error)}\n\n` + `Please check the ingredient name and try again.`, }, ], }; } }
- src/bar-assistant-mcp-server.ts:1260-1292 (registration)Registers the 'get_ingredient_info' tool with MCP server, defines input schema (ingredient_name string), references output schema, long description with use cases and examples. Handler dispatched via switch at line 1311.name: 'get_ingredient_info', description: `Get comprehensive information about cocktail ingredients and their usage. **Use Cases:** - Ingredient research: "what is Aperol?", "tell me about gin" - Substitution guidance: finding alternatives for unavailable ingredients - Usage exploration: see how ingredients are used across different cocktails - Flavor profile understanding: learn about ingredient characteristics **Response Format:** Returns detailed ingredient information including: - Ingredient description and characteristics - List of cocktails using this ingredient (with complete recipes) - Suggested substitutions with flavor impact notes - Common flavor profiles and tasting notes - Direct links to featured cocktails **Examples:** - {ingredient_name: "Campari"} → Campari info + Negroni, Boulevardier recipes - {ingredient_name: "rye whiskey"} → Usage in Manhattan, Sazerac, etc. - {ingredient_name: "elderflower liqueur"} → Aviation, Paper Plane recipes`, inputSchema: { type: 'object', properties: { ingredient_name: { type: 'string', description: 'The name of the ingredient to get information about', }, }, required: ['ingredient_name'], }, outputSchema: OutputSchemas.ingredientInfoOutputSchema, },
- src/output-schemas.ts:118-163 (schema)JSON Schema defining the structured output for get_ingredient_info: includes ingredient details, cocktail_usage array (with full cocktailResultSchema recipes), substitutions, query info, metadata. Referenced in tool registration.export const ingredientInfoOutputSchema = { type: "object", properties: { ingredient: { type: "string", description: "Ingredient name" }, description: { type: "string", description: "Ingredient description" }, cocktail_usage: { type: "array", items: { type: "object", properties: { cocktail: cocktailResultSchema, usage_notes: { type: "string", description: "How ingredient is used" } }, required: ["cocktail"] }, description: "Cocktails using this ingredient" }, substitutions: { type: "array", items: { type: "object", properties: { substitute: { type: "string", description: "Substitute ingredient" }, description: { type: "string", description: "Substitution explanation" }, flavor_impact: { type: "string", description: "Impact on flavor" } }, required: ["substitute", "description"] }, description: "Ingredient substitution suggestions" }, flavor_profiles: { type: "array", items: { type: "string" }, description: "Common flavor characteristics" }, query: { type: "object", properties: { ingredient_name: { type: "string", description: "Queried ingredient name" } }, required: ["ingredient_name"] }, metadata: responseMetadataSchema }, required: ["ingredient", "cocktail_usage", "query", "metadata"] };
- src/response-schemas.ts:139-157 (schema)TypeScript interface for IngredientInfoResponse used in handler implementation, defines structure matching the JSON schema with IngredientUsage (cocktail + notes) and SubstitutionSuggestion.export interface IngredientInfoResponse { /** Ingredient name */ ingredient: string; /** Description or information about the ingredient */ description?: string; /** Cocktails that use this ingredient */ cocktail_usage: IngredientUsage[]; /** Suggested substitutes */ substitutions?: SubstitutionSuggestion[]; /** Common flavor profiles */ flavor_profiles?: string[]; /** Query information */ query: { /** Original ingredient query */ ingredient_name: string; }; /** Response metadata */ metadata: ResponseMetadata; }