Skip to main content
Glama
davidashman

AnyList MCP Server

by davidashman

Add Meal Plan Event

add_meal_plan_event

Schedule recipes or custom events on specific dates in your meal plan calendar. Add meals by recipe name, ID, or custom title with optional labels like Breakfast, Lunch, or Dinner.

Instructions

Schedule a recipe or titled event on a specific day in the meal plan calendar.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dateYesDate in YYYY-MM-DD format
recipe_nameNoRecipe name to schedule (case-insensitive match)
recipe_idNoRecipe identifier for exact lookup
titleNoEvent title (used if no recipe specified, or as override)
labelNoMeal label, e.g. "Breakfast", "Lunch", "Dinner" (case-insensitive match)

Implementation Reference

  • Registration of the add_meal_plan_event tool.
    server.registerTool(
      'add_meal_plan_event',
      {
        title: 'Add Meal Plan Event',
        description:
          'Schedule a recipe or titled event on a specific day in the meal plan calendar.',
        inputSchema: z.object({
          date: z.string().describe('Date in YYYY-MM-DD format'),
          recipe_name: z.string().optional().describe('Recipe name to schedule (case-insensitive match)'),
          recipe_id: z.string().optional().describe('Recipe identifier for exact lookup'),
          title: z.string().optional().describe('Event title (used if no recipe specified, or as override)'),
          label: z.string().optional().describe('Meal label, e.g. "Breakfast", "Lunch", "Dinner" (case-insensitive match)'),
        }),
      },
  • Handler implementation for add_meal_plan_event tool.
      async ({ date, recipe_name, recipe_id, title, label }) => {
        try {
          const client = AnyListClient.getInstance();
    
          let recipeId = recipe_id;
          let eventTitle = title;
    
          // Resolve recipe by name if needed
          if (!recipeId && recipe_name) {
            const recipes = await client.getRecipes();
            const term = recipe_name.toLowerCase();
            const 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}` }],
                isError: true,
              };
            }
            recipeId = recipe.identifier;
            if (!eventTitle) eventTitle = recipe.name;
          }
    
          // Resolve label
          let labelId: string | undefined;
          if (label) {
            const labels = client.labels;
            const match = labels.find((l) => l.name?.toLowerCase() === label.toLowerCase());
            if (match) {
              labelId = match.identifier;
            }
          }
    
          const event = await client.createEvent({
            date: new Date(date + 'T12:00:00'),
            recipeId,
            title: eventTitle,
            labelId,
          });
          await event.save();
    
          return {
            content: [{
              type: 'text',
              text: `Meal plan event created: "${eventTitle ?? 'Untitled'}" on ${date}${label ? ` (${label})` : ''}`,
            }],
          };
        } catch (error) {
          return {
            content: [{ type: 'text', text: `Error creating meal plan event: ${error instanceof Error ? error.message : String(error)}` }],
            isError: true,
          };
        }
      },
    );
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the core action ('Schedule'). It lacks disclosure of mutation behavior (does it overwrite existing events?), validation rules (must recipe exist first?), or idempotency characteristics critical for a calendar scheduling tool.

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?

Single sentence with zero waste. Key verb 'Schedule' front-loaded, followed by content options and location. Every word serves a distinct purpose in conveying the tool's function.

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 5 parameters with complex conditional logic (recipe_id/name vs title) and no output schema or annotations, the description is incomplete. It omits success/failure behaviors, return value structure, and whether the operation is idempotent or destructive—essential context for calendar mutation operations.

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 100%, establishing baseline 3. The description adds high-level mapping ('recipe or titled event') that clarifies the parameter grouping logic, but doesn't add syntax details, format examples, or validation constraints 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?

The description uses specific verb 'Schedule' with clear resource 'meal plan calendar' and distinguishes content types ('recipe or titled event'). It effectively differentiates from sibling 'add_*_list' tools by using domain-specific terminology ('schedule' vs 'add', 'calendar' vs 'list').

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?

No guidance provided on when to use recipe_id vs recipe_name vs title, nor when to use get_meal_plan first to check existing events. The parameter relationships (mutually exclusive options) are undocumented, leaving agents to infer from schema descriptions 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/davidashman/anylist-mcp'

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