Skip to main content
Glama
Symfomany

Recettes MCP Server

by Symfomany

scale_recipe

Adjust recipe ingredient quantities to match desired serving sizes. Input a recipe name and target servings to calculate precise measurements.

Instructions

Scales a recipe for a different number of servings.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recipe_nameYes
servingsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:190-193 (registration)
    Registers the 'scale_recipe' tool with the MCP framework using the @mcp.tool decorator, specifying the name and description.
    @mcp.tool(
        name="scale_recipe",
        description="Scales a recipe for a different number of servings.",
    )
  • main.py:194-212 (handler)
    The main handler function for the 'scale_recipe' tool. It finds a recipe by name from the Christmas recipes list, scales the ingredient quantities (assuming gram units) proportional to the new number of servings, updates the recipe object, and returns the scaled recipe as a dictionary. Returns an error if the recipe is not found.
    async def scale_recipe(recipe_name: str, servings: int) -> Dict:
        """Met à l'échelle une recette pour un nombre de personnes différent."""
        for recipe in christmas_recipes():
            if recipe.name.lower() == recipe_name.lower():
                scaled_ingredients = {}
                for ingredient, quantity in recipe.ingredients.items():
                    try:
                        # Simple scaling, may not work for all units
                        amount, unit = quantity.split("g")
                        scaled_amount = (int(amount) / recipe.servings) * servings
                        scaled_ingredients[ingredient] = f"{scaled_amount:.0f}g"
                    except ValueError:
                        scaled_ingredients[ingredient] = quantity  # Cannot scale
                
                scaled_recipe = recipe.model_copy()
                scaled_recipe.servings = servings
                scaled_recipe.ingredients = scaled_ingredients
                return scaled_recipe.model_dump()
        return {"error": "Recette non trouvée."}
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 of behavioral disclosure. It states the tool scales a recipe, implying a read-and-modify operation, but doesn't disclose critical traits such as whether it returns the scaled recipe, if it modifies the original, authentication needs, error handling, or rate limits. This leaves significant gaps for an agent to understand the tool's behavior.

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 core purpose without unnecessary words. Every part ('Scales a recipe for a different number of servings') directly contributes to understanding the tool's function, making it highly concise and well-structured.

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

Completeness3/5

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

Given the tool's moderate complexity (2 parameters, no annotations, but has an output schema), the description is minimally adequate. It covers the basic purpose but lacks behavioral details, usage guidelines, and parameter nuances. The presence of an output schema means return values are documented elsewhere, reducing the burden, but overall completeness is limited due to missing context for safe and effective use.

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 0%, so the description must compensate for undocumented parameters. It mentions 'recipe' and 'servings', which map to the two parameters ('recipe_name' and 'servings'), adding basic meaning. However, it doesn't provide details like format constraints (e.g., string format for recipe_name, integer range for servings) or examples, leaving the schema to define structure without descriptive context.

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 ('Scales') and resource ('a recipe') with a specific purpose ('for a different number of servings'). It distinguishes from siblings like 'create_shopping_list' or 'generate_recipe_from_ingredients' by focusing on adjustment rather than creation or generation. However, it doesn't explicitly differentiate from all siblings (e.g., 'get_recipe_by_index' is for retrieval, but this isn't mentioned).

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. It doesn't mention prerequisites (e.g., needing an existing recipe), exclusions (e.g., not for creating new recipes), or direct comparisons to siblings like 'get_random_recipe' or 'search_by_ingredient'. Usage is implied from the purpose but not explicitly stated.

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/Symfomany/mcp-tuto'

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