get_task
Retrieve a specific task by its ID and project ID using the TickTick MCP Server, enabling precise task management and integration with AI assistants.
Instructions
Get a specific task by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Project ID containing the task (required) | |
| taskId | Yes | Task ID to retrieve (required) |
Implementation Reference
- src/ticktick-client.ts:342-351 (handler)Core implementation that performs the API call to retrieve a specific task by ID from the TickTick API using the projectId and taskId.async getTaskById(taskId: string, projectId: string): Promise<TickTickTask> { await this.ensureAuthenticated(); try { const response = await this.client.get(`/project/${projectId}/task/${taskId}`); return response.data; } catch (error) { throw new Error(`Failed to get task: ${error instanceof Error ? error.message : 'Unknown error'}`); } }
- src/index.ts:326-338 (handler)MCP server handler for the 'get_task' tool: validates input parameters, calls the TickTickClient.getTaskById method, and formats the response as MCP content.case 'get_task': if (!args?.taskId || !args?.projectId) { throw new McpError(ErrorCode.InvalidParams, 'Task ID and Project ID are required'); } const task = await this.ticktickClient!.getTaskById(args.taskId as string, args.projectId as string); return { content: [ { type: 'text', text: JSON.stringify(task, null, 2), }, ], };
- src/index.ts:197-213 (registration)Tool registration in the ListTools response, including name, description, and input schema definition.name: 'get_task', description: 'Get a specific task by ID', inputSchema: { type: 'object', properties: { taskId: { type: 'string', description: 'Task ID to retrieve (required)', }, projectId: { type: 'string', description: 'Project ID containing the task (required)', }, }, required: ['taskId', 'projectId'], }, },
- src/index.ts:199-213 (schema)Input schema definition for the 'get_task' tool, specifying required taskId and projectId parameters.inputSchema: { type: 'object', properties: { taskId: { type: 'string', description: 'Task ID to retrieve (required)', }, projectId: { type: 'string', description: 'Project ID containing the task (required)', }, }, required: ['taskId', 'projectId'], }, },