Skip to main content
Glama

update_preferences

Modify dietary preferences, allergen restrictions, and cuisine choices for personalized HelloFresh meal recommendations.

Instructions

Update your dietary and cuisine preferences on HelloFresh, such as vegetarian mode, allergen avoidance, and preferred cuisines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vegetarianNoEnable/disable vegetarian meal preference
family_friendlyNoEnable/disable family-friendly meals
dietary_preferencesNoList of dietary preferences to set
allergensNoList of allergens to avoid
cuisine_preferencesNoPreferred cuisine types

Implementation Reference

  • The handler for the 'update_preferences' tool that parses input with UpdatePreferencesSchema and calls this.hellofresh.updatePreferences() with mapped parameters
    case "update_preferences": {
      const params = UpdatePreferencesSchema.parse(args);
      const result = await this.hellofresh.updatePreferences({
        vegetarian: params.vegetarian,
        familyFriendly: params.family_friendly,
        dietaryPreferences: params.dietary_preferences,
        allergens: params.allergens,
        cuisinePreferences: params.cuisine_preferences,
      });
      return text(result);
    }
  • The actual implementation of updatePreferences() that navigates to HelloFresh preferences page via Playwright and updates vegetarian and family-friendly checkboxes
    async updatePreferences(
      preferences: Partial<Preferences>
    ): Promise<{ success: boolean; message: string }> {
      await this.ensureLoggedIn();
      const page = this.page!;
    
      await page.goto(`${this.baseUrl}/my-account/preferences`);
      await page.waitForLoadState("networkidle");
    
      // Update dietary preferences
      if (preferences.vegetarian !== undefined) {
        const vegCheckbox = page.locator(
          'input[value*="vegetarian"], [data-testid*="vegetarian"]'
        );
        if (await vegCheckbox.isVisible()) {
          const isChecked = await vegCheckbox.isChecked();
          if (preferences.vegetarian !== isChecked) {
            await vegCheckbox.click();
          }
        }
      }
    
      if (preferences.familyFriendly !== undefined) {
        const familyCheckbox = page.locator(
          'input[value*="family"], [data-testid*="family"]'
        );
        if (await familyCheckbox.isVisible()) {
          const isChecked = await familyCheckbox.isChecked();
          if (preferences.familyFriendly !== isChecked) {
            await familyCheckbox.click();
          }
        }
      }
    
      // Save preferences
      const saveBtn = page.locator(
        'button:has-text("Save"), button[type="submit"], [data-testid*="save-preferences"]'
      );
      if (await saveBtn.isVisible({ timeout: 3000 })) {
        await saveBtn.click();
        await page.waitForLoadState("networkidle");
      }
    
      return { success: true, message: "Preferences updated successfully." };
    }
  • UpdatePreferencesSchema - Zod schema defining input validation for vegetarian, family_friendly, dietary_preferences, allergens, and cuisine_preferences fields
    const UpdatePreferencesSchema = z.object({
      vegetarian: z
        .boolean()
        .optional()
        .describe("Enable/disable vegetarian meal preference"),
      family_friendly: z
        .boolean()
        .optional()
        .describe("Enable/disable family-friendly meals"),
      dietary_preferences: z
        .array(z.string())
        .optional()
        .describe("List of dietary preferences to set"),
      allergens: z
        .array(z.string())
        .optional()
        .describe("List of allergens to avoid"),
      cuisine_preferences: z
        .array(z.string())
        .optional()
        .describe("Preferred cuisine types"),
    });
  • src/index.ts:254-285 (registration)
    Tool registration for 'update_preferences' with description and JSON Schema inputSchema defining the tool's API contract for MCP clients
      name: "update_preferences",
      description:
        "Update your dietary and cuisine preferences on HelloFresh, such as vegetarian mode, allergen avoidance, and preferred cuisines.",
      inputSchema: {
        type: "object",
        properties: {
          vegetarian: {
            type: "boolean",
            description: "Enable/disable vegetarian meal preference",
          },
          family_friendly: {
            type: "boolean",
            description: "Enable/disable family-friendly meals",
          },
          dietary_preferences: {
            type: "array",
            items: { type: "string" },
            description: "List of dietary preferences to set",
          },
          allergens: {
            type: "array",
            items: { type: "string" },
            description: "List of allergens to avoid",
          },
          cuisine_preferences: {
            type: "array",
            items: { type: "string" },
            description: "Preferred cuisine types",
          },
        },
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions 'Update' which implies a mutation, but doesn't disclose behavioral traits such as whether changes are reversible, if specific permissions are required, what happens to existing preferences not mentioned, or any rate limits. This is a significant gap for a mutation tool with zero annotation coverage.

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?

The description is a single, efficient sentence that front-loads the key action and resource, with specific examples that earn their place by clarifying scope. There is no wasted text or redundancy.

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 that this is a mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral aspects like side effects, error handling, or response format, which are crucial for safe and effective use. The high schema coverage doesn't compensate for these gaps in context.

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?

The description lists examples of what can be updated (vegetarian mode, allergen avoidance, preferred cuisines), which aligns with some parameters in the schema. However, with 100% schema description coverage, the schema already fully documents all 5 parameters. The description adds minimal value beyond the schema, so a baseline score of 3 is appropriate.

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 clearly states the action ('Update') and resource ('dietary and cuisine preferences on HelloFresh'), with specific examples like vegetarian mode and allergen avoidance. However, it doesn't explicitly distinguish this tool from sibling tools like 'modify_subscription' or 'modify_delivery', which might also involve preference changes in a broader context.

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?

The description provides no guidance on when to use this tool versus alternatives. For instance, it doesn't clarify if this should be used instead of 'modify_subscription' for preference updates, or if there are prerequisites like having an active subscription. The context is implied but not explicit.

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/markswendsen-code/mcp-hellofresh'

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