Skip to main content
Glama
davidashman

AnyList MCP Server

by davidashman

Get Meal Plan

get_meal_plan

Retrieve scheduled meal events from AnyList for a specific date range to analyze eating patterns and plan future meals.

Instructions

Get meal plan events for a date range. Defaults to the current week (Mon-Sun). Use a 6-week lookback (e.g. start_date 6 weeks ago) to understand recent eating patterns when recommending new meals.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
start_dateNoStart date in YYYY-MM-DD format (defaults to this Monday)
end_dateNoEnd date in YYYY-MM-DD format (defaults to this Sunday)

Implementation Reference

  • The handler logic for 'get_meal_plan' which fetches, filters, and formats meal plan events.
    async ({ start_date, end_date }) => {
      try {
        const client = AnyListClient.getInstance();
        const events = await client.getMealPlanningCalendarEvents();
    
        const { start: defaultStart, end: defaultEnd } = getWeekBounds();
        const start = start_date ? new Date(start_date + 'T00:00:00') : defaultStart;
        const end = end_date ? new Date(end_date + 'T23:59:59') : defaultEnd;
    
        const filtered = events
          .filter((e) => {
            const d = new Date(e.date);
            return d >= start && d <= end;
          })
          .sort((a, b) => new Date(a.date).getTime() - new Date(b.date).getTime());
    
        const result = filtered.map((e) => ({
          id: e.identifier,
          date: e.date instanceof Date ? e.date.toISOString().slice(0, 10) : String(e.date).slice(0, 10),
          title: e.title ?? null,
          label: e.label?.name ?? null,
          recipeName: e.recipe?.name ?? null,
          recipeId: e.recipeId ?? null,
        }));
    
        return {
          content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
        };
      } catch (error) {
        return {
          content: [{ type: 'text', text: `Error fetching meal plan: ${error instanceof Error ? error.message : String(error)}` }],
          isError: true,
        };
      }
    },
  • The registration details for 'get_meal_plan' tool, including its schema and description.
    server.registerTool(
      'get_meal_plan',
      {
        title: 'Get Meal Plan',
        description:
          'Get meal plan events for a date range. Defaults to the current week (Mon-Sun). Use a 6-week lookback (e.g. start_date 6 weeks ago) to understand recent eating patterns when recommending new meals.',
        inputSchema: z.object({
          start_date: z.string().optional().describe('Start date in YYYY-MM-DD format (defaults to this Monday)'),
          end_date: z.string().optional().describe('End date in YYYY-MM-DD format (defaults to this Sunday)'),
        }),
      },
Behavior3/5

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

No annotations provided, so description carries full burden. Discloses default date range behavior (Mon-Sun). However, lacks disclosure of rate limits, empty result behavior, or data freshness guarantees expected for a read tool with no safety annotations.

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?

Three sentences optimally structured: purpose first, defaults second, usage recommendation third. No redundancy or filler; every sentence earns its place with actionable information.

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?

For a 2-parameter read tool with 100% schema coverage, description adequately covers purpose, defaults, and usage patterns. Minor gap: does not describe return value structure (though no output schema exists to reference).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% (baseline 3). Description adds semantic value by framing defaults as 'current week (Mon-Sun)' and providing concrete usage pattern 'start_date 6 weeks ago' that illustrates how to construct date ranges for pattern analysis.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb 'Get' + resource 'meal plan events' + scope 'date range'. Clearly distinguishes from sibling 'add_meal_plan_event' (mutator vs reader) and 'get_recipes' (events vs recipes).

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

Usage Guidelines4/5

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

Provides explicit positive guidance: 'Use a 6-week lookback... to understand recent eating patterns when recommending new meals.' Includes concrete example (6 weeks). Does not explicitly name alternatives to avoid, but clear differentiation from sibling tools.

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