mcp_howtocook_getAllRecipes
Retrieve all available recipes from the HowToCook repository to assist with meal planning and recipe recommendations for AI-powered personal chefs.
Instructions
获取所有菜谱
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| no_param | No | 无参数 |
Implementation Reference
- src/tools/getAllRecipes.ts:14-25 (handler)The core handler function for the 'mcp_howtocook_getAllRecipes' tool. It maps over the recipes using simplifyRecipeNameOnly to create simplified versions and returns them as a formatted JSON string within a text content block.async () => { // 返回更简化版的菜谱数据,只包含name和description const simplifiedRecipes = recipes.map(simplifyRecipeNameOnly); return { content: [ { type: "text", text: JSON.stringify(simplifiedRecipes, null, 2), }, ], }; }
- src/tools/getAllRecipes.ts:10-13 (schema)The Zod input schema definition for the tool, specifying an optional 'no_param' string parameter.{ 'no_param': z.string().optional() .describe('无参数') },
- src/tools/getAllRecipes.ts:7-26 (registration)The server.tool() call that registers the tool, including name, description, schema, and handler.server.tool( "mcp_howtocook_getAllRecipes", "获取所有菜谱", { 'no_param': z.string().optional() .describe('无参数') }, async () => { // 返回更简化版的菜谱数据,只包含name和description const simplifiedRecipes = recipes.map(simplifyRecipeNameOnly); return { content: [ { type: "text", text: JSON.stringify(simplifiedRecipes, null, 2), }, ], }; } );
- src/index.ts:56-56 (registration)The call to registerGetAllRecipesTool during MCP server instance creation, which triggers the tool registration.registerGetAllRecipesTool(server, recipes);