delete_meal
Remove a logged meal from your fitness tracker, with an option to delete associated food items to maintain accurate nutrition records.
Instructions
Delete a meal and optionally its items.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"meal_id": "<meal_id>"
},
"name": "delete_meal"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| meal_id | Yes | ||
| delete_items | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/main.py:600-609 (handler)The 'delete_meal' tool handler implementation. It optionally deletes associated meal items before deleting the meal itself.
def delete_meal(meal_id: int, delete_items: bool = True) -> dict[str, bool]: """Delete a meal and optionally its items.""" conn = get_connection() cursor = conn.cursor() if delete_items: cursor.execute("DELETE FROM meal_items WHERE meal_id = ?", (meal_id,)) cursor.execute("DELETE FROM meals WHERE id = ?", (meal_id,)) conn.commit() conn.close() return {"deleted": cursor.rowcount > 0}