Skip to main content
Glama

add_todo

Add tasks with temporal planning and context fields for better organization. Supports single tasks or batch imports with auto-categorization of time estimates, energy levels, and work types.

Instructions

Add todo(s) with enhanced temporal and context fields.

SINGLE MODE: Provide title and optional parameters BATCH MODE: Provide todos_batch as JSON string

New fields for temporal planning:

  • timeframe: When to work on task (this_week, next_sprint, this_month, this_quarter, someday)

  • energy_required: Energy level needed (high, medium, low)

  • theme_tag: Type of work (sprint_work, strategic, admin, learning)

  • linked_goal_id: Link to a goal

  • blocked_by: What's blocking this task

Auto-categorization (both modes):

  • Theme tags from keywords (sprint/strategic/admin/learning)

  • Time estimates from notes ("30min", "2h")

  • Quick win detection (<= 30min)

  • Timeframe suggestions from keywords + priority

  • Energy level suggestions from keywords

Batch mode example (JSON string):

[
    {"title": "Smoke test GPU endpoints", "priority": "high", "timeframe": "this_week"},
    {"title": "Review platform architecture", "priority": "medium"},
    {"title": "Update ADO board", "quick": true}
]

Args: title: Task title (required for single mode) priority: Priority level - 'low', 'medium', or 'high' notes: Additional notes or context quick: Mark as quick win timeframe: When to do this (this_week, next_sprint, this_month, this_quarter, someday) energy_required: Energy level (high, medium, low) theme_tag: Work type (sprint_work, strategic, admin, learning) linked_goal_id: ID of related goal blocked_by: What's blocking this todos_batch: JSON string of todos for batch mode

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleNo
priorityNomedium
notesNo
quickNo
timeframeNo
energy_requiredNomedium
theme_tagNo
linked_goal_idNo
blocked_byNo
todos_batchNo

Implementation Reference

  • The 'add_todo' tool implementation in 'src/coach_ai/server.py'. It handles single todo creation and batch todo processing by calling 'add_todos_batch'.
    async def add_todo(
        title: Optional[str] = None,
        priority: str = "medium",
        notes: str = "",
        quick: bool = False,
        timeframe: Optional[str] = None,
        energy_required: str = "medium",
        theme_tag: Optional[str] = None,
        linked_goal_id: Optional[int] = None,
        blocked_by: Optional[str] = None,
        todos_batch: Optional[str] = None,
    ) -> str:
        """Add todo(s) with enhanced temporal and context fields.
    
        SINGLE MODE: Provide title and optional parameters
        BATCH MODE: Provide todos_batch as JSON string
    
        New fields for temporal planning:
        - timeframe: When to work on task (this_week, next_sprint, this_month, this_quarter, someday)
        - energy_required: Energy level needed (high, medium, low)
        - theme_tag: Type of work (sprint_work, strategic, admin, learning)
        - linked_goal_id: Link to a goal
        - blocked_by: What's blocking this task
    
        Auto-categorization (both modes):
        - Theme tags from keywords (sprint/strategic/admin/learning)
        - Time estimates from notes ("30min", "2h")
        - Quick win detection (<= 30min)
        - Timeframe suggestions from keywords + priority
        - Energy level suggestions from keywords
    
        Batch mode example (JSON string):
        ```
        [
            {"title": "Smoke test GPU endpoints", "priority": "high", "timeframe": "this_week"},
            {"title": "Review platform architecture", "priority": "medium"},
            {"title": "Update ADO board", "quick": true}
        ]
        ```
    
        Args:
            title: Task title (required for single mode)
            priority: Priority level - 'low', 'medium', or 'high'
            notes: Additional notes or context
            quick: Mark as quick win
            timeframe: When to do this (this_week, next_sprint, this_month, this_quarter, someday)
            energy_required: Energy level (high, medium, low)
            theme_tag: Work type (sprint_work, strategic, admin, learning)
            linked_goal_id: ID of related goal
            blocked_by: What's blocking this
            todos_batch: JSON string of todos for batch mode
        """
        db = await storage.get_db()
    
        # BATCH MODE
        if todos_batch:
            try:
                batch_list = json.loads(todos_batch)
                result = await add_todos_batch(batch_list, db, auto_categorize=True)
    
                response = f"✓ Created {result['created_count']} todos\n"
                if result['suggestions']:
                    response += "\nAuto-categorization:\n"
                    for suggestion in result['suggestions'][:5]:  # Limit to 5
                        response += f"  • {suggestion}\n"
                return response
            except json.JSONDecodeError as e:
                return f"Error: Invalid JSON in todos_batch: {e}"
    
        # SINGLE MODE
        if not title:
            return "Error: Either 'title' or 'todos_batch' must be provided"
    
        todo_data = {
            "title": title,
            "priority": priority,
            "notes": notes,
            "quick": quick,
            "timeframe": timeframe,
            "energy_required": energy_required,
            "theme_tag": theme_tag,
            "linked_goal_id": linked_goal_id,
            "blocked_by": blocked_by,
        }
    
        result = await add_todos_batch([todo_data], db, auto_categorize=True)
        created_todo = result["created_todos"][0]
    
        response = f"✓ Added todo #{created_todo['id']}: {title}\n"
        response += f"  Priority: {created_todo['priority']}"
    
        if created_todo.get('timeframe'):
            response += f" | Timeframe: {created_todo['timeframe']}"
        if created_todo.get('time_estimate'):
            response += f" | Time: {created_todo['time_estimate']}min"
        if created_todo.get('quick'):
            response += " | Quick win"
    
        if result['suggestions']:
            response += f"\n  Auto-categorized: {', '.join(result['suggestions'])}"
    
        if created_todo.get('time_estimate') and created_todo['time_estimate'] > 120:
            response += f"\n  💡 Large task ({created_todo['time_estimate']}min). Consider using break_down_task() to split it."
    
        return response
  • The 'add_todo' tool is registered using the @mcp.tool() decorator in 'src/coach_ai/server.py'.
    @mcp.tool()

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