Skip to main content
Glama

set_todo_timeframe

Assign a timeframe to tasks for better planning and prioritization, using options like this week, next sprint, or this quarter to organize your schedule.

Instructions

Assign temporal timeframe to a todo.

Args: todo_id: ID of the todo timeframe: One of: this_week, next_sprint, this_month, this_quarter, someday reason: Optional reason for this timeframe

Returns: Confirmation message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
todo_idYes
timeframeYes
reasonNo

Implementation Reference

  • The function 'set_todo_timeframe' handles the assignment of a timeframe to a todo item in the database, including validation and optional note addition to task_context.
    async def set_todo_timeframe(
        todo_id: int,
        timeframe: str,
        reason: Optional[str] = None,
    ) -> str:
        """Assign temporal timeframe to a todo.
    
        Args:
            todo_id: ID of the todo
            timeframe: One of: this_week, next_sprint, this_month, this_quarter, someday
            reason: Optional reason for this timeframe
    
        Returns:
            Confirmation message
        """
        db = await storage.get_db()
    
        # Validate timeframe
        valid_timeframes = ["this_week", "next_sprint", "this_month", "this_quarter", "someday"]
        if timeframe not in valid_timeframes:
            return f"Error: Invalid timeframe. Must be one of: {', '.join(valid_timeframes)}"
    
        # 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"
    
        # Update timeframe
        await db.execute(
            "UPDATE todos SET timeframe = ? WHERE id = ?",
            (timeframe, todo_id),
        )
    
        # Optionally add reason to task_context
        if reason:
            context_note = f"[{datetime.now().isoformat()}] Timeframe set to {timeframe}: {reason}"
            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"✓ Set timeframe for #{todo_id} '{row['title']}' to: {timeframe}"
  • The 'set_todo_timeframe' tool is registered using the '@mcp.tool()' decorator.
    @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