Skip to main content
Glama

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
meal_idYes
delete_itemsNo

Implementation Reference

  • 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}

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/JohnZolton/MCP-logger'

If you have feedback or need assistance with the MCP directory API, please join our Discord server