Skip to content

feat(47): Get Project Tasks can return Completed Tasks in TickTick MCP#48

Open
milichev wants to merge 4 commits into
jacepark12:mainfrom
milichev:fix/completed-tasks-support
Open

feat(47): Get Project Tasks can return Completed Tasks in TickTick MCP#48
milichev wants to merge 4 commits into
jacepark12:mainfrom
milichev:fix/completed-tasks-support

Conversation

@milichev

@milichev milichev commented Mar 6, 2026

Copy link
Copy Markdown

📋 Description

This PR fixes #47 by adding of support for retrieving completed/finished tasks from TickTick projects through the MCP integration. Previously, only active tasks could be retrieved using the /project/{id}/data endpoint. This implementation uses the proper POST /task/completed endpoint to fetch completed tasks while maintaining full backward compatibility.

🎯 Problem Solved

Users could not view their completed tasks through the MCP interface, limiting visibility into project history and task completion status. This was particularly limiting for audit trails and project retrospectives.

✅ Solution

  • Implement the TickTick Open API's /task/completed endpoint
  • Add configurable date range filtering (past year to tomorrow)
  • Extend get_project_tasks() with optional include_completed parameter
  • Default behavior (backward compatible): Only active tasks
  • Opt-in behavior: Both active and completed tasks

🔄 Backward Compatibility

Fully backward compatible

  • Default parameter value is False
  • Existing code continues to work without modification
  • Safe opt-in approach for gradual adoption

🧪 Testing & Validation

Sandbox Testing (3 tasks total)

  • Without completed: 2 active tasks ✅
  • With completed: 3 total tasks (2 active + 1 completed) ✅

Production Testing (Tax project)

  • Without completed: 0 active tasks shown ✅
  • With completed: 9 completed tasks retrieved ✅

API Verification

  • ✅ Correct endpoint: POST /task/completed
  • ✅ Proper date range filtering
  • ✅ Response format handling
  • ✅ Error handling for empty results

📝 Changes Made

ticktick_mcp/src/ticktick_client.py

def get_project_completed_tasks(self, project_id: str) -> List[Dict]:
    """Gets completed tasks for a specific project using POST /task/completed endpoint"""
  • Uses proper TickTick API endpoint
  • Implements date range from past 365 days to tomorrow
  • Returns list of completed task dictionaries

ticktick_mcp/src/server.py

@mcp.tool()
async def get_project_tasks(project_id: str, include_completed: bool = False) -> str:
  • Added include_completed parameter (default: False)
  • When False: Returns only active tasks
  • When True: Returns both active and completed tasks with clear separation
  • Maintains clean, readable output format

💡 Benefits

  1. Complete Task Visibility: Users can now see their completed work
  2. Backward Compatible: No breaking changes for existing users
  3. Opt-In Design: Safe and gradual rollout strategy
  4. Production Ready: Thoroughly tested with real data

🔗 Related Issues

Closes: Missing support for completed tasks in TickTick MCP integration

📚 Documentation

Parameter documentation added to get_project_tasks() docstring:

include_completed: Whether to include completed tasks (default: False for backward compatibility)

Type: Feature
Breaking Change: No
Impact: Medium (new optional feature)

@milichev milichev changed the title Get Project Tasks can return Completed Tasks in TickTick MCP feat(47): Get Project Tasks can return Completed Tasks in TickTick MCP Mar 6, 2026
@milichev milichev changed the title feat(47): Get Project Tasks can return Completed Tasks in TickTick MCP feat(#47): Get Project Tasks can return Completed Tasks in TickTick MCP Mar 6, 2026
@milichev milichev changed the title feat(#47): Get Project Tasks can return Completed Tasks in TickTick MCP feat(47): Get Project Tasks can return Completed Tasks in TickTick MCP Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing support for completed tasks in TickTick MCP integration (get_project_tasks tool)

1 participant