Skip to main content
Glama
worryzyy

HowToCook-MCP Server

by worryzyy

mcp_howtocook_getRecipesByCategory

Retrieve recipes by category such as seafood, breakfast, desserts, or soups to simplify meal planning using the HowToCook repository.

Instructions

根据分类查询菜谱,可选分类有: 水产, 早餐, 调料, 甜品, 饮品, 荤菜, 半成品加工, 汤, 主食, 素菜

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYes菜谱分类名称,如水产、早餐、荤菜、主食等

Implementation Reference

  • Registers the 'mcp_howtocook_getRecipesByCategory' tool with MCP server, defining schema and handler inline.
    export function registerGetRecipesByCategoryTool(server: McpServer, recipes: Recipe[], categories: string[]) {
      server.tool(
        "mcp_howtocook_getRecipesByCategory",
        `根据分类查询菜谱,可选分类有: ${categories.join(', ')}`,
        {
          category: z.enum(categories as [string, ...string[]])
                    .describe('菜谱分类名称,如水产、早餐、荤菜、主食等')
        },
        async ({ category }: { category: string }) => {
          const filteredRecipes = recipes.filter((recipe) => recipe.category === category);
          // 返回简化版的菜谱数据
          const simplifiedRecipes = filteredRecipes.map(simplifyRecipe);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(simplifiedRecipes, null, 2),
              },
            ],
          };
        }
      );
    } 
  • Handler function that filters recipes by given category, simplifies them using simplifyRecipe, and returns JSON-formatted list in MCP text content format.
    async ({ category }: { category: string }) => {
      const filteredRecipes = recipes.filter((recipe) => recipe.category === category);
      // 返回简化版的菜谱数据
      const simplifiedRecipes = filteredRecipes.map(simplifyRecipe);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(simplifiedRecipes, null, 2),
          },
        ],
      };
    }
  • Input schema using Zod: 'category' parameter as enum of provided categories with description.
    {
      category: z.enum(categories as [string, ...string[]])
                .describe('菜谱分类名称,如水产、早餐、荤菜、主食等')
    },
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 only states what the tool does (query by category) without mentioning any behavioral traits like whether it's read-only, what the output format might be, potential rate limits, error conditions, or authentication needs. For a query tool with zero annotation coverage, this is a significant gap.

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 appropriately sized and front-loaded: it starts with the core purpose ('根据分类查询菜谱') followed by the category list. Every sentence earns its place—no redundant or verbose language. It's efficient and easy to parse.

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 tool's simplicity (1 parameter, 100% schema coverage) but lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., list of recipes, error handling) or behavioral aspects. For a query tool, this leaves gaps in understanding how to interpret results or handle failures.

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 description lists the available categories, which adds meaning beyond the input schema's enum values. However, with 100% schema description coverage (the schema already documents the 'category' parameter with enum and description), the description doesn't provide additional parameter semantics like examples of usage, edge cases, or format details. The baseline is 3 when schema coverage is high.

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: '根据分类查询菜谱' (query recipes by category). It specifies the verb '查询' (query) and resource '菜谱' (recipes), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'mcp_howtocook_getAllRecipes' or 'mcp_howtocook_getRecipeById', which would require a 5.

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 lists categories but doesn't mention when to choose this over 'mcp_howtocook_getAllRecipes' (all recipes) or 'mcp_howtocook_getRecipeById' (specific recipe). There's no context about prerequisites, exclusions, or typical use cases, leaving the agent to infer usage.

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

Related 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/worryzyy/HowToCook-mcp'

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