← 返回
未分类 Key 中文

hash health

Hash Health — personal nutrition tracking, meal logging, medication management, and daily health dashboard. Use when user mentions food, meals, eating, loggi...
Hash Health — 个人营养追踪、膳食记录、药物管理与每日健康仪表盘。适用于用户提及食物、餐食、饮食、记录...
devak208
未分类 clawhub v1.0.9 1 版本 100000 Key: 需要
★ 0
Stars
📥 458
下载
💾 0
安装
1
版本
#latest

概述

You are connected to Hash Health, a personal nutrition and health tracking platform.

> All data is sent to the user's own Hash Health account. No data goes to third parties.


CRITICAL RULES

Food image received (user sends a photo):

  1. Call hash_upload_image immediately with the image — do NOT describe or ask first
  2. Call detectIngredients with your visual analysis as text parameters
  3. Show detected ingredients from the tool result — ask "Confirm to save, or edit?"
  4. After user confirms → call analyze_food with image_path from step 1

Food text received ("I ate X", "log X", "save X"):

  • Call hash_analyze_and_log immediately — no asking first

Only pause point: After detectIngredients returns, show the list and wait for "yes/save/looks good" before calling analyze_food.

Never:

  • Describe the food or give your own nutrition estimates before calling tools
  • Ask "shall I log this?" before calling tools
  • Call analyze_food before user confirms ingredients
  • Save a meal unless user explicitly says save/log/track

Auth check

Before any request call hash_get_daily_nutrition with no arguments. If auth error → tell user:

> "Set your HASH_HEALTH_TOKEN in OpenClaw settings. Get it from Hash Health app → Settings → Advanced → Generate API Key."


Setup

POST https://hash-claude-mcp.vercel.app/api/mcp
Authorization: Bearer $HASH_HEALTH_TOKEN
Content-Type: application/json
Accept: application/json, text/event-stream

All calls use JSON-RPC:

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": { "name": "<tool_name>", "arguments": { ... } },
  "id": 1
}

Result is always in response.result.content[0].text


Log a meal — from image

Step 1 — Upload the image immediately (no text to user first)

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "hash_upload_image",
    "arguments": {
      "image_url": "<attachment URL if available>",
      "image_data_url": "<data:image/jpeg;base64,... if available>",
      "mime_type": "image/jpeg"
    }
  },
  "id": 1
}

Provide exactly ONE of: image_url, image_data_url, or image_base64.

Save the path from the response — you will pass it to analyze_food later.

Step 2 — Call detectIngredients with your visual analysis

Pack everything you see in the image into the parameters. Pass ALL ingredients — if you pass a vague list you get a generic result.

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "detectIngredients",
    "arguments": {
      "food_name": "<dish name you identified>",
      "ingredients_list": [
        "rice ~200g",
        "egg ~50g",
        "onion ~30g",
        "oil ~10g"
      ],
      "portion_size": "<total estimated weight e.g. 290g>",
      "visual_notes": "<brief description e.g. fried rice in a bowl>"
    }
  },
  "id": 2
}

Step 3 — Show result and ask for confirmation

Display the ingredient list from the tool result verbatim, then ask:

> "Detected: Egg Fried Rice

> 1. Rice (~200g)

> 2. Egg (~50g)

> 3. Onion (~30g)

> 4. Oil (~10g)

> ✅ Confirm to save, or tell me what to add/edit/remove?"

Step 4 — Wait for confirmation, then call analyze_food

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "analyze_food",
    "arguments": {
      "food_name": "<dish name>",
      "selected_ingredients": ["rice", "egg", "onion", "oil"],
      "ingredient_sizes_g": {
        "rice": "200g",
        "egg": "50g",
        "onion": "30g",
        "oil": "10g"
      },
      "is_customized_ingredients": true,
      "save_to_history": true,
      "image_path": "<path from hash_upload_image step>"
    }
  },
  "id": 3
}

Show: dish name, calories, protein, carbs, fat. Confirm saved ✅

Important: selected_ingredients is an array of names. ingredient_sizes_g is an object mapping name → gram string. Never use ingredients_list in analyze_food.


Log a meal — from text

Trigger: "log X", "I ate X", "save X", "track X" — call immediately, no asking.

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "hash_analyze_and_log",
    "arguments": {
      "food_name": "<dish name and description>",
      "save": true,
      "language": "en"
    }
  },
  "id": 1
}

Show: dish name, calories, protein, carbs, fat. Confirm saved.


Check today's nutrition

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "hash_get_daily_nutrition",
    "arguments": { "date": "<YYYY-MM-DD or omit for today>" }
  },
  "id": 1
}

Display: calories, protein (g), carbs (g), fat (g), fiber (g), streak.


Daily dashboard

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "hash_daily_dashboard",
    "arguments": { "date": "<YYYY-MM-DD or omit>" }
  },
  "id": 1
}

View meal history

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "hash_get_meal_history",
    "arguments": {
      "limit": 10,
      "date": "<YYYY-MM-DD or omit for today>"
    }
  },
  "id": 1
}

JSON.parse the analysis field — see Parsing meal analysis data below.


Delete a meal

Step 1 — get meal ID:

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": { "name": "hash_get_meal_history", "arguments": { "limit": 20 } },
  "id": 1
}

Step 2 — confirm: "Delete [dish name] logged at [time]?"

Step 3 — delete:

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "hash_delete_meal",
    "arguments": { "id": "<UUID>" }
  },
  "id": 2
}

Weekly report

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": { "name": "hash_weekly_report", "arguments": {} },
  "id": 1
}

List medications

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": { "name": "hash_get_medications", "arguments": {} },
  "id": 1
}

Add a medication

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "hash_add_medication",
    "arguments": {
      "name": "<medication name>",
      "dosage": "<e.g. 500mg>",
      "frequency": "<e.g. twice daily>",
      "time_of_day": ["morning", "evening"],
      "notes": ""
    }
  },
  "id": 1
}

Delete a medication

Step 1 — get ID: hash_get_medications

Step 2 — confirm with user

Step 3:

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "hash_delete_medication",
    "arguments": { "id": <numeric id> }
  },
  "id": 2
}

Note: medication id is a number, not a string.


Bedtime summary

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": { "name": "hash_get_bedtime_summary", "arguments": {} },
  "id": 1
}

Nutrition chat

When: User asks a health/nutrition question.

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "nutrition_chat",
    "arguments": {
      "messages": [
        { "role": "user", "content": "<user's question>" }
      ]
    }
  },
  "id": 1
}

Parsing meal analysis data

The analysis field in meal history is always a JSON string — always JSON.parse() it first.

Two possible formats:

ValueFormat A (current)Format B (legacy)
---------------------------------------------
Dish namedishNamedish
CaloriesnutritionalInfo.calories_kcalnutrition.calories
ProteinnutritionalInfo.proteins_gnutrition.protein
CarbsnutritionalInfo.carbohydrates_gnutrition.carbs
FatnutritionalInfo.fats_gnutrition.fat
FibernutritionalInfo.fiber_gnutrition.fiber
SugarnutritionalInfo.sugar_gnutrition.sugar
Serving sizeestimatedServingSize_gestimated_serving_size_g
Categorycategorycategory
Summaryanalysissummary

Detect format: dishName present → Format A. dish present → Format B.

Always display:

🍽 <dish name>
Calories: X kcal | Protein: Xg | Carbs: Xg | Fat: Xg | Fiber: Xg

Rules

  • Always use today's date (YYYY-MM-DD) when no date is specified.
  • Never guess a meal UUID or medication ID — look it up first.
  • Always confirm before deleting.
  • Medication id is a number — not a string.
  • Never ask the user to paste their token in chat — always use OpenClaw environment settings.
  • If token is missing/invalid: "Set your HASH_HEALTH_TOKEN in OpenClaw settings. Hash Health app → Settings → Advanced → Generate API Key."

版本历史

共 1 个版本

  • v1.0.9 当前
    2026-05-03 10:49 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,350 📥 317,724
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,211 📥 266,187
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 667 📥 323,821