Skip to main content
Glama

complete_todo

Mark tasks as completed in Coach AI's task management system by specifying the todo ID to track progress and maintain productivity.

Instructions

Mark a todo as complete.

Args: todo_id: The ID of the todo to complete

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
todo_idYes

Implementation Reference

  • The core logic that updates the todo status to 'completed' in the database.
    async def complete_todo(todo_id: int) -> str:
        """Mark a todo as complete.
    
        Args:
            todo_id: The ID of the todo to complete
    
        Returns:
            Success message or error
        """
        db = await get_db()
    
        # Get todo title for confirmation
        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."
    
        # Mark as complete
        await db.execute(
            "UPDATE todos SET status = 'completed', completed_at = CURRENT_TIMESTAMP WHERE id = ?",
            (todo_id,),
        )
        await db.commit()
    
        return f"✓ Completed: {row['title']}"
  • The MCP tool registration using @mcp.tool() and the wrapper function that calls the storage handler.
    @mcp.tool()
    async def complete_todo(todo_id: int) -> str:
        """Mark a todo as complete.
    
        Args:
            todo_id: The ID of the todo to complete
        """
        return await storage.complete_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