Pairing Guide
pairing_guideFind beer and food pairings by searching a beer style or dish name. Get suggestions based on complement, contrast, and cleanse principles.
Instructions
Get beer and food pairing suggestions. Search by beer style or dish name. Returns pairing matches with complement, contrast, and cleanse principles.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Beer style or dish name to find pairings for |
Implementation Reference
- src/register-tools.ts:7-7 (registration)Import of registerPairingGuide from the pairing-guide module; registered on line 15.
import { registerPairingGuide } from "./tools/pairing-guide.js"; - src/register-tools.ts:15-15 (registration)Calls registerPairingGuide(server) to register the pairing_guide tool.
registerPairingGuide(server); - src/tools/pairing-guide.ts:21-71 (handler)The full implementation: registers the 'pairing_guide' tool on the MCP server. Uses fuzzySearch to search PAIRINGS data by style name and dish name, deduplicates results, and returns formatted text with pairing principles. Returns a 'no results' message if nothing found.
export function registerPairingGuide(server: McpServer): void { server.registerTool( "pairing_guide", { title: "Pairing Guide", description: "Get beer and food pairing suggestions. Search by beer style or dish name. Returns pairing matches with complement, contrast, and cleanse principles.", inputSchema: { query: z .string() .describe("Beer style or dish name to find pairings for"), }, }, async ({ query }) => { // Search by style name let results = fuzzySearch(PAIRINGS, query, ["style"]); // Also search by dish text const byDish = fuzzySearch(PAIRINGS, query, ["dishes"]); // Merge, deduplicating const seen = new Set(results.map((r) => r.style)); for (const p of byDish) { if (!seen.has(p.style)) { results.push(p); seen.add(p.style); } } if (results.length === 0) { return { content: [ { type: "text" as const, text: `No pairing suggestions found for '${query}'. Try a beer style (e.g. 'IPA', 'Stout', 'Pilsner') or a food (e.g. 'steak', 'cheese', 'chocolate').`, }, ], }; } return { content: [ { type: "text" as const, text: results.map(formatPairing).join("\n\n---\n\n"), }, ], }; }, ); } - src/tools/pairing-guide.ts:7-19 (helper)Formats a single FoodPairing into markdown text: style heading, dishes, principles, and optional avoid list.
function formatPairing(pairing: FoodPairing): string { const lines = [ `## ${pairing.style}`, `Dishes: ${pairing.dishes.join(", ")}`, "", "Pairing principles:", ...pairing.principles.map((p) => `- ${p}`), ]; if (pairing.avoid.length > 0) { lines.push("", `Avoid: ${pairing.avoid.join(", ")}`); } return lines.join("\n"); } - src/tools/pairing-guide.ts:28-32 (schema)Input schema for the tool: accepts a single 'query' string parameter (beer style or dish name to find pairings for).
inputSchema: { query: z .string() .describe("Beer style or dish name to find pairings for"), },