Skip to main content
Glama

get_todays_tasks

Retrieve tasks due today from the TickTick task management service, optionally filtered by project ID, to stay organized and meet deadlines.

Instructions

Get tasks that are specifically due today

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdNoOptional project ID to filter today's tasks

Implementation Reference

  • MCP tool handler for 'get_todays_tasks' that invokes TickTickClient.getTodaysTasks with optional projectId and returns the JSON-stringified result.
    case 'get_todays_tasks': const todaysTasks = await this.ticktickClient!.getTodaysTasks(args?.projectId as string); return { content: [ { type: 'text', text: JSON.stringify(todaysTasks, null, 2), }, ], };
  • Input schema definition for the 'get_todays_tasks' tool, specifying optional projectId parameter.
    { name: 'get_todays_tasks', description: 'Get tasks that are specifically due today', inputSchema: { type: 'object', properties: { projectId: { type: 'string', description: 'Optional project ID to filter today\'s tasks', }, }, }, },
  • Core helper method in TickTickClient that fetches raw tasks and filters for those due today using isTaskDueToday, then enhances for display.
    async getTodaysTasks(projectId?: string): Promise<any[]> { // Get raw tasks for filtering logic const allTasks = await this.getTasksRaw(projectId); const todaysTasks = allTasks.filter(task => isTaskDueToday(task)); return todaysTasks.map(task => enhanceTaskForDisplay(task)); }
  • Key helper function that determines if a task is due today, handling all-day tasks, timezone adjustment by adding 1 day, and filtering out completed tasks.
    function isTaskDueToday(task: TickTickTask): boolean { // If task is completed, it's not due today if (task.completedTime) { return false; } // If no due date, it's not due today if (!task.dueDate) { return false; } try { // Get current date/time const now = new Date(); // Parse due date and add 1 day to compensate for timezone difference const dueDate = new Date(task.dueDate); const adjustedDueDate = new Date(dueDate.getTime() + (24 * 60 * 60 * 1000)); // Add 1 day // If it's an all-day task, compare dates only if (task.allDay) { const today = now.toISOString().split('T')[0]; const adjustedDueDateStr = adjustedDueDate.toISOString().split('T')[0]; // Task is due today if adjusted due date equals today return adjustedDueDateStr === today; } // For timed tasks, check if it's due today (same date) const today = now.toISOString().split('T')[0]; const adjustedDueDateStr = adjustedDueDate.toISOString().split('T')[0]; return adjustedDueDateStr === today; } catch (error) { // If date parsing fails, assume not due today return false; } }
  • Helper function that enhances tasks with human-readable priority text for better display in responses.
    function enhanceTaskForDisplay(task: TickTickTask): any { const enhanced = { ...task }; // Add human-readable priority let priorityText = 'None'; switch (task.priority) { case 0: priorityText = 'None'; break; case 1: priorityText = 'Low'; break; case 3: priorityText = 'Medium'; break; case 5: priorityText = 'High'; break; default: priorityText = task.priority ? `Custom (${task.priority})` : 'None'; } return { ...enhanced, priorityText, // Keep original dates for display - they should show correctly dueDate: task.dueDate }; }

Other Tools

Related Tools

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/rafliruslan/ticktick-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server