Skip to main content
Glama

delete_todo

Remove completed or unnecessary tasks from your Coach AI to-do list by specifying the task ID, helping maintain an organized and focused productivity system.

Instructions

Delete a todo permanently.

Args: todo_id: The ID of the todo to delete

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
todo_idYes

Implementation Reference

  • The storage-level implementation of the delete_todo logic, interacting directly with the database.
    async def delete_todo(todo_id: int) -> str:
        """Delete a todo permanently.
    
        Args:
            todo_id: The ID of the todo to delete
    
        Returns:
            Success message or error
        """
        db = await get_db()
    
        cursor = await db.execute("SELECT title FROM todos WHERE id = ?", (todo_id,))
        row = await cursor.fetchone()
    
        if not row:
            return f"Error: Todo #{todo_id} not found."
    
        await db.execute("DELETE FROM todos WHERE id = ?", (todo_id,))
        await db.commit()
    
        return f"✓ Deleted: {row['title']}"
  • The MCP tool registration and handler wrapper for delete_todo.
    @mcp.tool()
    async def delete_todo(todo_id: int) -> str:
        """Delete a todo permanently.
    
        Args:
            todo_id: The ID of the todo to delete
        """
        return await storage.delete_todo(todo_id)

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/94aharris/coach-ai'

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