update_task
Modify an existing task by updating its title, content, due date, priority, or tags using the task ID. Integrates with TickTick for efficient task management.
Instructions
Update an existing task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | New task description/content | |
| dueDate | No | New due date in ISO format | |
| priority | No | New task priority (0=None, 1=Low, 3=Medium, 5=High) | |
| tags | No | New task tags | |
| taskId | Yes | Task ID to update (required) | |
| title | No | New task title |
Implementation Reference
- src/index.ts:284-296 (handler)MCP CallTool handler for 'update_task': validates required taskId argument and delegates to TickTickClient.updateTask, formatting the response as MCP content.case 'update_task': if (!args?.taskId) { throw new McpError(ErrorCode.InvalidParams, 'Task ID is required'); } const updatedTask = await this.ticktickClient!.updateTask(args.taskId as string, args); return { content: [ { type: 'text', text: `Task updated successfully: ${JSON.stringify(updatedTask, null, 2)}`, }, ], };
- src/index.ts:125-159 (registration)Registration of the 'update_task' tool in the ListTools response, including name, description, and JSON input schema defining parameters like taskId (required), title, content, etc.{ name: 'update_task', description: 'Update an existing task', inputSchema: { type: 'object', properties: { taskId: { type: 'string', description: 'Task ID to update (required)', }, title: { type: 'string', description: 'New task title', }, content: { type: 'string', description: 'New task description/content', }, dueDate: { type: 'string', description: 'New due date in ISO format', }, priority: { type: 'number', description: 'New task priority (0=None, 1=Low, 3=Medium, 5=High)', }, tags: { type: 'array', items: { type: 'string' }, description: 'New task tags', }, }, required: ['taskId'], }, },
- src/ticktick-client.ts:310-319 (helper)TickTickClient helper method that performs the actual API call to update a task by posting updates to /task/{taskId} endpoint after ensuring authentication.async updateTask(taskId: string, updates: Partial<TickTickTask>): Promise<TickTickTask> { await this.ensureAuthenticated(); try { const response = await this.client.post(`/task/${taskId}`, updates); return response.data; } catch (error) { throw new Error(`Failed to update task: ${error instanceof Error ? error.message : 'Unknown error'}`); } }