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
| Name | Required | Description | Default |
|---|---|---|---|
| todo_id | Yes | ||
| timeframe | Yes | ||
| reason | No |
Implementation Reference
- src/coach_ai/server.py:350-398 (handler)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}" - src/coach_ai/server.py:349-349 (registration)The 'set_todo_timeframe' tool is registered using the '@mcp.tool()' decorator.
@mcp.tool()