get_task
Retrieve a specific task from TickTick using its task ID and project ID to access detailed task information for management or review.
Instructions
Get a specific task by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskId | Yes | Task ID to retrieve (required) | |
| projectId | Yes | Project ID containing the task (required) |
Implementation Reference
- src/index.ts:326-338 (handler)MCP handler for 'get_task' tool: validates taskId and projectId, fetches task using TickTickClient.getTaskById, returns JSON stringified task.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:196-213 (registration)Registration of 'get_task' tool in ListTools handler, defining name, description, and input schema.{ 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/ticktick-client.ts:342-351 (helper)TickTickClient method implementing the API call to retrieve a specific task by 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'}`); } }