Skip to main content
Glama

add_task_context

Add context notes to tasks to track progress, reasons, blockers, or links. Helps maintain task clarity and continuity in productivity systems.

Instructions

Add context note to task (where left off, why doing it, etc).

Args: todo_id: ID of the todo context: Context note to add context_type: Type of context (progress, why, blocker, link)

Returns: Confirmation message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
todo_idYes
contextYes
context_typeNoprogress

Implementation Reference

  • The implementation of the 'add_task_context' tool, which updates the task_context column in the database with a timestamped note.
    async def add_task_context(
        todo_id: int,
        context: str,
        context_type: str = "progress",
    ) -> str:
        """Add context note to task (where left off, why doing it, etc).
    
        Args:
            todo_id: ID of the todo
            context: Context note to add
            context_type: Type of context (progress, why, blocker, link)
    
        Returns:
            Confirmation message
        """
        db = await storage.get_db()
    
        # Get todo
        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"
    
        # Add timestamped context
        context_note = f"[{datetime.now().isoformat()}] [{context_type}] {context}"
    
        await db.execute(
            """
            UPDATE todos
            SET task_context = COALESCE(task_context || '\\n' || ?, ?)
            WHERE id = ?
            """,
            (context_note, context_note, todo_id),
        )
        await db.commit()
    
        return f"✓ Added {context_type} context to #{todo_id} '{row['title']}'"

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