delete_meal_item
Remove a specific meal entry from your nutrition log by providing its item ID. This action helps maintain accurate food tracking records in your personal fitness database.
Instructions
Delete a meal item.
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": {
"item_id": "<item_id>"
},
"name": "delete_meal_item"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| item_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/main.py:588-596 (handler)Implementation of the delete_meal_item MCP tool, which removes a record from the meal_items table in the database.
@app.tool() def delete_meal_item(item_id: int) -> dict[str, bool]: """Delete a meal item.""" conn = get_connection() cursor = conn.cursor() cursor.execute("DELETE FROM meal_items WHERE id = ?", (item_id,)) conn.commit() conn.close() return {"deleted": cursor.rowcount > 0}