API & MCP
Everything a person can do on Weekly Meal Planner, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://weeklymealplanner.usefulweb.site/api/v1/calculate– run Weekly Meal PlannerGET https://weeklymealplanner.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Weekly Meal Planner
List what is in your fridge and cupboards (with quantities and best-before dates) and your preferences (vegetarian, vegan, pescatarian, maximum cooking time, ingredients to avoid). The planner picks one dinner per day from about 60 simple home-cooking recipes, using food that expires soonest first, and adds up a shopping list of everything still missing.
| Field | Type | Default | Description |
|---|---|---|---|
startDate | date | — | First day. Default: today. |
days | integer | 7 | Number of days |
servings | integer | 2 | People per meal |
diet | select (any, vegetarian, vegan, pescatarian) | "any" | Diet |
maxMinutes | integer | 45 | Maximum cooking time |
pantry | table | — | Pantry and fridge. Leave the quantity empty if you are not sure (counted as enough). Best-before dates make the planner use those items first. |
exclude | list | — | Avoid these ingredients. One per line, e.g. mushrooms or feta. Recipes containing them are skipped. |
Example request
Use up spinach, eggs and chicken this week
curl -X POST https://weeklymealplanner.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"startDate":"2026-10-19","days":7,"servings":2,"diet":"any","maxMinutes":45,"pantry":[{"item":"Spinach","quantity":250,"unit":"g","expires":"2026-10-20"},{"item":"Eggs","quantity":6,"unit":"pcs","expires":"2026-10-28"},{"item":"Chicken breast","quantity":300,"unit":"g","expires":"2026-10-21"},{"item":"Rice","quantity":1,"unit":"kg"},{"item":"Onions","quantity":4,"unit":"pcs"},{"item":"Canned tomatoes","quantity":800,"unit":"g"},{"item":"Feta","quantity":200,"unit":"g","expires":"2026-10-23"},{"item":"Pasta","quantity":500,"unit":"g"}]}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://weeklymealplanner.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
weekly_meal_planner - Local stdio connector:
node src/mcp-stdio.ts --tool=weekly-meal-planner
{
"mcpServers": {
"weekly-meal-planner": { "type": "http", "url": "https://weeklymealplanner.usefulweb.site/mcp" }
}
}