find_recipe_standards
Retrieve standardized recipes and preparation guidelines for specific dishes from food service documentation.
Instructions
Find standardized recipes and preparation methods for specific dishes
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cuisine_type | No | ||
| dish_name | Yes | Name of the dish to find recipe standards for |
Implementation Reference
- src/index.js:455-501 (handler)The core handler function for the 'find_recipe_standards' tool. It constructs search terms based on dish_name and optional cuisine_type, searches the PDF content using pdfParser.searchContent, deduplicates results, and formats a text response with up to 8 matching standards.async function findRecipeStandards(dish_name, cuisine_type) { const recipeTerms = [ dish_name, `рецепт ${dish_name}`, `стандарт ${dish_name}`, `приготовление ${dish_name}`, `recipe ${dish_name}`, `standard ${dish_name}`, `preparation ${dish_name}` ]; if (cuisine_type) { recipeTerms.push(`${cuisine_type} ${dish_name}`); } let allResults = []; for (const term of recipeTerms) { const results = pdfParser.searchContent(term); if (results.results) { allResults.push(...results.results); } } const uniqueResults = allResults.filter((result, index, self) => index === self.findIndex(r => r.content === result.content) ); let response = `Recipe standards for "${dish_name}"`; if (cuisine_type) response += ` (${cuisine_type} cuisine)`; response += ":\n\n"; if (uniqueResults.length === 0) { response += "No specific recipe standards found for this dish."; } else { uniqueResults.slice(0, 8).forEach((result, index) => { response += `Standard ${index + 1}:\n`; response += `${result.content}\n\n`; }); } return { content: [{ type: "text", text: response }] }; }
- src/index.js:111-114 (schema)Zod schema defining the input parameters for the tool: required dish_name (string) and optional cuisine_type (string). Used for validation in the tool dispatcher.const findRecipeStandardsSchema = z.object({ dish_name: z.string().describe("Name of the dish to find recipe standards for"), cuisine_type: z.string().optional().describe("Optional: type of cuisine or cooking style"), });
- src/index.js:196-200 (registration)Tool registration in the toolDefinitions array returned by ListToolsRequestHandler. Specifies name, description, and inputSchema converted from Zod schema.{ name: "find_recipe_standards", description: "Find standardized recipes and preparation methods for specific dishes", inputSchema: zodToJsonSchema(findRecipeStandardsSchema) }
- src/tools.js:391-437 (handler)Alternative implementation of the handler function in the GoodbookTools class. Identical logic to the one in index.js, using class instance's pdfParser.async findRecipeStandards(dishName, cuisineType = null) { const recipeTerms = [ dishName, `рецепт ${dishName}`, `стандарт ${dishName}`, `приготовление ${dishName}`, `recipe ${dishName}`, `standard ${dishName}`, `preparation ${dishName}` ]; if (cuisineType) { recipeTerms.push(`${cuisineType} ${dishName}`); } let allResults = []; for (const term of recipeTerms) { const results = this.pdfParser.searchContent(term); if (results.results) { allResults.push(...results.results); } } const uniqueResults = allResults.filter((result, index, self) => index === self.findIndex(r => r.content === result.content) ); let response = `Recipe standards for "${dishName}"`; if (cuisineType) response += ` (${cuisineType} cuisine)`; response += ":\n\n"; if (uniqueResults.length === 0) { response += "No specific recipe standards found for this dish."; } else { uniqueResults.slice(0, 8).forEach((result, index) => { response += `Standard ${index + 1}:\n`; response += `${result.content}\n\n`; }); } return { content: [{ type: "text", text: response }] }; }
- src/tools.js:96-113 (registration)Tool definition in GoodbookTools.getToolDefinitions() method, including inline JSON schema.{ name: "find_recipe_standards", description: "Find standardized recipes and preparation methods for specific dishes", inputSchema: { type: "object", properties: { dish_name: { type: "string", description: "Name of the dish to find recipe standards for" }, cuisine_type: { type: "string", description: "Optional: type of cuisine or cooking style" } }, required: ["dish_name"] } }