update_task
Modify existing task properties like title, content, due date, priority, or status in TickTick/Dida365 task management systems.
Instructions
Modify an existing task's properties. Can update title, content, due date, priority or status. At least taskId is required. Returns the updated task details.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskId | Yes | The ID of the task to update (required) | |
| title | No | New title for the task | |
| content | No | New content/description for the task | |
| dueDate | No | New due date in ISO 8601 format | |
| priority | No | Updated priority level (0-5) | |
| status | No | Task completion status (0: incomplete, 1: complete) |
Implementation Reference
- src/index.ts:407-427 (handler)The handler function for the 'update_task' tool. It extracts the taskId and optional update fields from arguments, constructs a Partial<Task> object, performs a PUT request to the Dida365 API at `/task/${taskId}`, and returns the response details.case "update_task": { const taskId = args.taskId as string; const updateData: Partial<Task> = {}; if (args.title) updateData.title = args.title as string; if (args.content) updateData.content = args.content as string; if (args.dueDate) updateData.dueDate = args.dueDate as string; if (args.priority !== undefined) updateData.priority = args.priority as number; if (args.status !== undefined) updateData.status = args.status as number; const response: AxiosResponse = await dida365Api.put(`/task/${taskId}`, updateData); return { content: [ { type: "text", text: `任务更新成功: ${JSON.stringify(response.data, null, 2)}`, }, ], }; }
- src/index.ts:171-202 (schema)The input schema definition for the 'update_task' tool, specifying required taskId and optional fields for updating task properties.name: "update_task", description: "Modify an existing task's properties. Can update title, content, due date, priority or status. At least taskId is required. Returns the updated task details.", inputSchema: { type: "object", properties: { taskId: { type: "string", description: "The ID of the task to update (required)", }, title: { type: "string", description: "New title for the task", }, content: { type: "string", description: "New content/description for the task", }, dueDate: { type: "string", description: "New due date in ISO 8601 format", }, priority: { type: "number", description: "Updated priority level (0-5)", }, status: { type: "number", description: "Task completion status (0: incomplete, 1: complete)", }, }, required: ["taskId"], },
- src/index.ts:170-203 (registration)Registration of the 'update_task' tool in the list of available tools returned by ListToolsRequestSchema, including name, description, and input schema.{ name: "update_task", description: "Modify an existing task's properties. Can update title, content, due date, priority or status. At least taskId is required. Returns the updated task details.", inputSchema: { type: "object", properties: { taskId: { type: "string", description: "The ID of the task to update (required)", }, title: { type: "string", description: "New title for the task", }, content: { type: "string", description: "New content/description for the task", }, dueDate: { type: "string", description: "New due date in ISO 8601 format", }, priority: { type: "number", description: "Updated priority level (0-5)", }, status: { type: "number", description: "Task completion status (0: incomplete, 1: complete)", }, }, required: ["taskId"], }, },