Skip to main content
Glama
WhenYouAreStrange

goodbook-mcp

search_food_standards

Find specific food preparation standards, recipes, and cooking guidelines from food service literature by searching with keywords or phrases.

Instructions

Search for specific food preparation standards, recipes, or cooking guidelines in the food service literature

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch term or phrase to look for in the food standards document
sectionNo

Implementation Reference

  • The primary handler function that executes the 'search_food_standards' tool logic: expands the search query with synonyms, performs multiple searches on the PDF parser, deduplicates results, and returns formatted text output.
    async function searchFoodStandards(query, section) {
      // Расширенный поиск с синонимами
      const expandedQueries = expandSearchQuery(query);
      let allResults = [];
      
      for (const searchQuery of expandedQueries) {
        const results = pdfParser.searchContent(searchQuery, section);
        if (results.results) {
          allResults.push(...results.results);
        }
      }
      
      // Удаляем дубликаты
      const uniqueResults = allResults.filter((result, index, self) => 
        index === self.findIndex(r => r.content === result.content)
      );
      
      let response = `Search results for "${query}"`;
      if (section) {
        response += ` in section "${section}"`;
      }
      response += `:\n\nFound ${uniqueResults.length} matches\n\n`;
    
      if (uniqueResults.length === 0) {
        response += "No matching content found.";
      } else {
        uniqueResults.slice(0, 15).forEach((result, index) => {
          response += `Result ${index + 1}:\n`;
          if (result.before) response += `Context: ${result.before}\n`;
          response += `> ${result.content}\n`;
          if (result.after) response += `Context: ${result.after}\n`;
          response += "\n";
        });
      }
    
      return {
        content: [{
          type: "text",
          text: response
        }]
      };
    }
  • Zod schema for input validation of the 'search_food_standards' tool, defining 'query' as required string and 'section' as optional string.
    const searchFoodStandardsSchema = z.object({
      query: z.string().describe("Search term or phrase to look for in the food standards document"),
      section: z.string().optional().describe("Optional: specific section to search within"),
    });
  • src/index.js:168-171 (registration)
    Tool registration in the list_tools response: defines name, description, and converts Zod schema to JSON schema for MCP protocol.
      name: "search_food_standards",
      description: "Search for specific food preparation standards, recipes, or cooking guidelines in the food service literature",
      inputSchema: zodToJsonSchema(searchFoodStandardsSchema)
    },
  • src/index.js:222-225 (registration)
    Dispatcher case in the CallToolRequestSchema handler that parses input with schema and invokes the tool handler function.
    case "search_food_standards": {
      const { query, section } = searchFoodStandardsSchema.parse(args);
      return await searchFoodStandards(query, section);
    }
  • Helper function used by the handler to expand search queries using a synonyms dictionary for more comprehensive PDF content matching.
    function expandSearchQuery(query) {
      const synonyms = {
        // Синонимы для блюд
        'котлеты': ['котлеты', 'биточки', 'зразы'],
        'картофельные': ['картофельные', 'картофель', 'из картофеля'],
        'морковные': ['морковные', 'морковь', 'из моркови', 'морковочные'],
        'творог': ['творог', 'творожный', 'сыр творожный', 'кварк'],
        'суп': ['суп', 'похлебка', 'бульон', 'борщ', 'щи', 'солянка'],
        'пиво': ['пиво', 'пивной', 'с пивом', 'на пиве'],
        'сладкий': ['сладкий', 'десертный', 'фруктовый'],
        'плов': ['плов', 'рис с мясом', 'узбекский плов'],
        'борщ': ['борщ', 'свекольный суп', 'украинский борщ'],
        'паста': ['паста', 'макароны', 'спагетти', 'лапша'],
        'тирамису': ['тирамису', 'итальянский десерт', 'маскарпоне'],
        'пельмени': ['пельмени', 'вареники', 'манты', 'хинкали'],
        'салат': ['салат', 'оливье', 'овощной'],
        'десерт': ['десерт', 'сладкое', 'торт', 'пирог', 'выпечка'],
        
        // Синонимы для процессов
        'приготовление': ['приготовление', 'готовка', 'варка', 'жарка', 'тушение'],
        'температура': ['температура', 'градус', 'нагрев', 'охлаждение'],
        'безопасность': ['безопасность', 'гигиена', 'санитария', 'чистота'],
        'хранение': ['хранение', 'консервация', 'сохранность'],
        
        // Синонимы для ингредиентов
        'мясо': ['мясо', 'говядина', 'свинина', 'баранина', 'курица'],
        'овощи': ['овощи', 'морковь', 'лук', 'капуста', 'картофель'],
        'специи': ['специи', 'приправы', 'пряности', 'соль', 'перец']
      };
      
      const queryWords = query.toLowerCase().split(/\s+/);
      const expandedQueries = [query]; // Включаем оригинальный запрос
      
      // Добавляем варианты с синонимами
      for (const word of queryWords) {
        if (synonyms[word]) {
          for (const synonym of synonyms[word]) {
            if (synonym !== word) {
              const newQuery = query.replace(new RegExp(word, 'gi'), synonym);
              if (!expandedQueries.includes(newQuery)) {
                expandedQueries.push(newQuery);
              }
            }
          }
        }
      }
      
      return expandedQueries;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'searches' but doesn't describe what the search returns (e.g., list of results, full documents, snippets), whether it's paginated, if there are rate limits, or any authentication requirements. This leaves significant gaps for a search tool.

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

Conciseness4/5

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

The description is a single, efficient sentence that front-loads the core purpose. It could be slightly more structured (e.g., by explicitly mentioning parameters), but it avoids redundancy and wastes no words.

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 lack of annotations, no output schema, and incomplete parameter documentation (50% coverage), the description is insufficient. It doesn't explain what the tool returns, how results are formatted, or behavioral traits like search scope or limitations, making it inadequate for a search tool with multiple sibling alternatives.

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 50% (only 'query' has a description). The description mentions 'search for specific food preparation standards, recipes, or cooking guidelines', which adds context that the 'query' parameter should target these topics, but doesn't clarify the 'section' parameter (which has an empty description in the schema). This partially compensates but doesn't fully address the coverage gap.

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 specific verbs ('search for') and resources ('food preparation standards, recipes, or cooking guidelines'), and identifies the source ('food service literature'). However, it doesn't explicitly differentiate from sibling tools like 'find_recipe_standards' or 'get_cooking_guidelines', which appear to have overlapping domains.

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. With sibling tools like 'find_recipe_standards', 'get_cooking_guidelines', and 'get_food_safety_info', there's no indication of how this tool differs in scope or context, leaving the agent to guess based on tool names alone.

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/WhenYouAreStrange/goodbook-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server