Skip to main content
Glama
kureha4

HowToCook-MCP Server

by kureha4

mcp_howtocook_getAllRecipes

Retrieve all recipes from a Chinese cooking database to help users find meal ideas, plan weekly menus, and solve the "what to eat today" problem.

Instructions

获取所有菜谱

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
no_paramNo无参数

Implementation Reference

  • Executes the tool logic: simplifies all recipes to name and description only, stringifies to JSON, and returns in MCP content format.
    async () => {
      // 返回更简化版的菜谱数据,只包含name和description
      const simplifiedRecipes = recipes.map(simplifyRecipeNameOnly);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(simplifiedRecipes, null, 2),
          },
        ],
      };
    }
  • Input schema using Zod: optional string parameter 'no_param'.
    {
      'no_param': z.string().optional()
                       .describe('无参数')
    },
  • Registers the tool on the MCP server with name, description, input schema, and handler function.
    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)
    Invokes the registration function during server instance creation, passing the server and loaded recipes.
    registerGetAllRecipesTool(server, recipes);
  • Utility function that simplifies a Recipe to just name and description, used in the tool handler.
    export function simplifyRecipeNameOnly(recipe: Recipe): NameOnlyRecipe {
      return {
        name: recipe.name,
        description: recipe.description
      };
    }

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/kureha4/mcptest1'

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