Skip to main content
Glama
rafliruslan

TickTick MCP Server

by rafliruslan

get_tasks

Retrieve tasks from TickTick, optionally filtering by project to manage and organize your to-do list effectively.

Instructions

Get all tasks or tasks from a specific project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdNoOptional project ID to filter tasks

Implementation Reference

  • src/index.ts:39-51 (registration)
    Registration of the 'get_tasks' tool in the ListTools response, including name, description, and input schema definition.
    {
      name: 'get_tasks',
      description: 'Get all tasks or tasks from a specific project',
      inputSchema: {
        type: 'object',
        properties: {
          projectId: {
            type: 'string',
            description: 'Optional project ID to filter tasks',
          },
        },
      },
    },
  • Handler for the 'get_tasks' tool in the CallToolRequestSchema switch statement. It calls TickTickClient.getTasks and returns the tasks as JSON text content.
    case 'get_tasks':
      const tasks = await this.ticktickClient!.getTasks(args?.projectId as string);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(tasks, null, 2),
          },
        ],
      };
  • Main helper function implementing the task retrieval logic from TickTick API, handling both project-specific and all tasks, with inbox handling and error management.
    async getTasks(projectId?: string): Promise<TickTickTask[]> {
      await this.ensureAuthenticated();
      
      try {
        if (projectId) {
          // Get tasks from a specific project using project data endpoint
          const response = await this.client.get(`/project/${projectId}/data`);
          const tasks = response.data?.tasks || [];
          return tasks.map((task: TickTickTask) => enhanceTaskForDisplay(task));
        } else {
          // Get all tasks by getting all projects and their tasks
          const projects = await this.getProjects();
          const allTasks: TickTickTask[] = [];
          
          for (const project of projects) {
            try {
              // Some special handling may be needed for inbox project
              const projectResponse = await this.client.get(`/project/${project.id}/data`);
              const projectTasks = projectResponse.data?.tasks || [];
              allTasks.push(...projectTasks);
            } catch (error) {
              // Skip projects that can't be accessed, but log more details
              console.warn(`Could not access tasks for project ${project.id} (${project.name}):`, error);
            }
          }
          
          // Also try to get inbox tasks specifically if inbox wasn't included
          try {
            const inboxResponse = await this.client.get('/project/inbox/data');
            const inboxTasks = inboxResponse.data?.tasks || [];
            allTasks.push(...inboxTasks);
          } catch (error) {
            // Inbox might not be accessible this way, try alternative
            try {
              const inboxResponse = await this.client.get('/task?projectId=inbox');
              const inboxTasks = inboxResponse.data || [];
              allTasks.push(...inboxTasks);
            } catch (inboxError) {
              console.warn('Could not access inbox tasks:', inboxError);
            }
          }
          
          return allTasks.map(task => enhanceTaskForDisplay(task));
        }
      } catch (error) {
        // Log more detailed error information
        if (error instanceof Error && 'response' in error) {
          const axiosError = error as any;
          const errorData = axiosError.response?.data ? JSON.stringify(axiosError.response.data) : axiosError.message;
          throw new Error(`Failed to get tasks: ${axiosError.response?.status} ${axiosError.response?.statusText} - ${errorData}`);
        }
        throw new Error(`Failed to get tasks: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • Helper utility function used by getTasks to enhance task objects with human-readable priority text.
    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
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves tasks but doesn't describe key behaviors such as pagination, sorting, rate limits, authentication needs, or what happens if no tasks exist. For a read operation with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded and appropriately sized for its function, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a task retrieval tool with no annotations, no output schema, and multiple sibling tools, the description is incomplete. It lacks details on return format, error handling, or behavioral traits, which are crucial for an AI agent to use it effectively in context with alternatives like 'get_todays_tasks.'

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the parameter 'projectId' documented as 'Optional project ID to filter tasks.' The description adds marginal value by mentioning 'tasks from a specific project,' which aligns with the schema but doesn't provide additional semantics like format examples or constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('tasks'), specifying that it retrieves either all tasks or tasks from a specific project. However, it doesn't explicitly distinguish this tool from siblings like 'get_task' (singular) or 'get_todays_tasks' (time-filtered), which would require mentioning scope or filtering differences.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by mentioning 'all tasks or tasks from a specific project,' which suggests using it for broad retrieval with optional project filtering. However, it doesn't provide explicit guidance on when to choose this over alternatives like 'get_todays_tasks' or 'get_overdue_tasks,' nor does it mention prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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