Twinkle HubTwinkle Hub
Sign in

📌 2026-08-17 added: ⚖️ Taiwan statute time machine — historical article text · revision history · full-text search · citation graph (935 datasets · 35,454+ rows)

View full changelog →

Total nutrition of a meal (food→grams)

tw_analyze_meal_nutrition

TW-specificMIT

**關鍵字 / Keywords**: 餐點營養分析 總熱量 三大營養素 meal nutrition analyze calories macros

給定一頓餐 (食物名 → 克數), 算總營養成分.

Args:
    meal: {"雞蛋": 50, "白米": 150, "豬肉": 80}  — values in grams
    nutrients: 要算的營養素 list (default 8 個: 粗蛋白/粗脂肪/總碳水
               /熱量/鈉/鈣/鐵/膳食纖維). 自動 alias.
    limit_per_food: 每食物 candidate 數 (default 30, 給多 variant 食物用)

Returns:
    {input_meal, matched_foods, total, ambiguous, unmatched, disclaimer}
    - total: 餐點總計各營養素數值
    - ambiguous: 有多重 match 的食物 (best match 是 row 數最多者)
    - unmatched: 沒 match 的食物 (corpus 沒有)

典型用例:
    tw_analyze_meal_nutrition({"雞蛋": 50, "白米": 150})
    tw_analyze_meal_nutrition({"豆腐": 100, "高麗菜": 80},
                           nutrients=["蛋白質", "鈉", "鈣"])

Input schema

{
  "properties": {
    "meal": {
      "additionalProperties": true,
      "title": "Meal",
      "type": "object"
    },
    "nutrients": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Nutrients"
    },
    "limit_per_food": {
      "default": 30,
      "title": "Limit Per Food",
      "type": "integer"
    }
  },
  "required": [
    "meal"
  ],
  "title": "tw_analyze_meal_nutritionArguments",
  "type": "object"
}

How to call

Once your Twinkle Hub MCP client is configured, your agent will see tw_analyze_meal_nutrition. Just ask it to call — example:

# Ask Claude / any MCP client:
請用 tw_analyze_meal_nutrition 處理 "…"。

# It will call:
tw_analyze_meal_nutrition(input="…")

Haven't set up a client yet?

Claude Desktop in 3 minutes — download the .mcpb and double-click, or see docs for other clients.

See user docs