Skip to main content
Glama
davidashman

AnyList MCP Server

by davidashman

Get Recipe Details

get_recipe_details

Retrieve complete recipe information including ingredients and preparation steps by searching with a recipe name or identifier.

Instructions

Get full details of a specific recipe including ingredients and preparation steps. Look up by name or ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recipe_nameNoRecipe name to look up (case-insensitive partial match)
recipe_idNoRecipe identifier for exact lookup

Implementation Reference

  • Registration of the 'get_recipe_details' tool.
    server.registerTool(
      'get_recipe_details',
      {
        title: 'Get Recipe Details',
        description:
          'Get full details of a specific recipe including ingredients and preparation steps. Look up by name or ID.',
        inputSchema: z.object({
          recipe_name: z.string().optional().describe('Recipe name to look up (case-insensitive partial match)'),
          recipe_id: z.string().optional().describe('Recipe identifier for exact lookup'),
        }),
      },
  • The handler function implementing the logic for 'get_recipe_details'.
      async ({ recipe_name, recipe_id }) => {
        try {
          if (!recipe_name && !recipe_id) {
            return {
              content: [{ type: 'text', text: 'Error: provide either recipe_name or recipe_id' }],
              isError: true,
            };
          }
    
          const client = AnyListClient.getInstance();
          const recipes = await client.getRecipes();
    
          let recipe;
          if (recipe_id) {
            recipe = recipes.find((r) => r.identifier === recipe_id);
          } else if (recipe_name) {
            const term = recipe_name.toLowerCase();
            recipe = recipes.find((r) => r.name?.toLowerCase() === term)
              ?? recipes.find((r) => r.name?.toLowerCase().includes(term));
          }
    
          if (!recipe) {
            return {
              content: [{ type: 'text', text: `Recipe not found: ${recipe_name ?? recipe_id}` }],
              isError: true,
            };
          }
    
          const details = {
            id: recipe.identifier,
            name: recipe.name,
            rating: recipe.rating ?? null,
            cookTime: recipe.cookTime ?? null,
            prepTime: recipe.prepTime ?? null,
            servings: recipe.servings ?? null,
            note: recipe.note ?? null,
            sourceName: recipe.sourceName ?? null,
            sourceUrl: recipe.sourceUrl ?? null,
            nutritionalInfo: recipe.nutritionalInfo ?? null,
            ingredients: recipe.ingredients.map((i) => ({
              rawIngredient: i.rawIngredient,
              name: i.name,
              quantity: i.quantity,
              note: i.note,
            })),
            preparationSteps: recipe.preparationSteps,
          };
    
          return {
            content: [{ type: 'text', text: JSON.stringify(details, null, 2) }],
          };
        } catch (error) {
          return {
            content: [{ type: 'text', text: `Error fetching recipe details: ${error instanceof Error ? error.message : String(error)}` }],
            isError: true,
          };
        }
      },
    );
Behavior3/5

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

No annotations provided, so description carries full burden. It compensates partially by disclosing return content (ingredients, preparation steps) since no output schema exists. However, it omits safety properties (read-only), error behavior (not found), and whether partial name matches return single or multiple results.

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?

Two efficiently structured sentences with zero waste. First sentence front-loads the action and return value; second covers parameter usage. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Appropriate for tool complexity. Without an output schema, the description usefully enumerates what 'details' include (ingredients, steps). Could improve by noting error cases or search behavior, but adequate for a simple lookup tool.

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 has 100% description coverage (case-insensitive partial match vs exact lookup), establishing baseline 3. Description reinforces the lookup methods ('name or ID') but adds no additional semantic context beyond what the schema already provides.

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?

Clear verb (Get) + resource (recipe details) and scope (ingredients, preparation steps). Implicitly distinguishes from sibling 'get_recipes' by specifying 'specific recipe' and 'full details', though it doesn't explicitly name the alternative.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides lookup method guidance ('Look up by name or ID'), implying the two identification options. However, lacks explicit when-to-use guidance versus 'get_recipes' and doesn't clarify that at least one parameter is required despite the schema showing zero required fields.

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/davidashman/anylist-mcp'

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