MCP server for nutritional data lookup and calculation
Food-tracking-ai demonstrates solid tool design with proper verb-noun naming, complete input schemas, and good parameter descriptions. All 4 tools are properly registered with Zod schemas and clear purpose. However, output schemas are not documented (no description of what fields are returned), and error handling lacks actionable recovery guidance. The tool names follow conventions well (search_food, get_nutrition, calculate_meal, save_food), descriptions are substantive (60-120 chars each), and parameters are well-constrained with enums and descriptions. Missing: documented output structure, per-item error handling for batch operations (calculate_meal), and error messages that guide the LLM toward next steps.
Calculate total nutrition for a meal by summing nutrients across multiple food items. Each item is looked up individually and totals are computed deterministically.
Get nutritional breakdown for a specific amount of a specific food. Supports weight units (g, kg, oz, lb), volume units (cup, tbsp, tsp, fl_oz, mL, L) when density data is available, and descriptive sizes (piece, medium, large, small, slice) when portion data is available.
Save custom food nutrition data (from restaurant lookups, nutrition labels, etc.) for consistent future retrieval. If a food with the same name and brand already exists, it will be updated.
Search for foods across USDA, Open Food Facts, and saved custom foods
Output schemas not documented. Tools return JSON strings but no schema describes what fields clients should expect (calories, protein_g, error, results array structure, etc.). LLMs cannot plan downstream calls or extract data reliably without knowing response structure.
Error handling returns generic error messages without recovery guidance. Example: 'Unknown error during food search' tells the LLM nothing about what went wrong or what to try next. Should specify: was it a network timeout? Invalid food ID? No results found? Each maps to a different recovery strategy.
calculate_meal lacks per-item error handling. If one food item fails to load, the entire meal calculation fails. For a 10-item meal, failure on item 8 should return results for items 1-7 plus a structured error on item 8, not abandon all 7 successful lookups.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 0 | <=2025-11-25 | v2 |
| 2026-03-09 | C | 69 | - | v1 |
save_food parameter 'nutrients' is loosely typed. It accepts an object with properties, but no minItems or required field enforcement. Should clarify: are calories and protein required? If not provided, are they assumed zero or null? Ambiguity invites silent data loss.
No pagination support on search_food. A search for 'apple' could return 100+ results. Without limit/offset and a total count, large result sets risk blowing context windows and degrading LLM reasoning. Description should state result limits and pagination strategy.