update_project_by_projectID
Modify an existing project's properties including name, color, view mode, kind, and sort order using its unique ID. Returns updated project details for task management.
Instructions
Update an existing project's properties. Requires project ID. Can modify name, color, view mode, kind and sort order. Returns updated project details.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | The ID of the project to update (required) | |
| name | No | New name for the project | |
| color | No | New hex color code for the project | |
| sortOrder | No | Updated sort order value | |
| viewMode | No | Updated view mode: "list", "kanban", or "timeline" | |
| kind | No | Updated project kind: "TASK" or "NOTE" |
Implementation Reference
- src/index.ts:478-497 (handler)Handler for the 'update_project_by_projectID' tool. Validates input using throwValidError, constructs Project object from arguments, performs API POST to update project, and returns response as text content.case "update_project_by_projectID":{ const project: Project = { id : args.projectId as string, name: args.name as string, ...(args.color ? { color: args.color as string } : {}), ...(args.sortOrder ? {sortOrder: args.sortOrder as number}:0), ...(args.viewMode ? {viewMode: args.viewMode as string}:{}), ...(args.kind ? {kind:args.kind as string}:{}) }; throwValidError(args.projectId as string,"1"); const response: AxiosResponse = await dida365Api.post("/project", project); return { content: [ { type: "text", text: `项目创建成功: ${JSON.stringify(response.data, null, 2)}`, }, ], };
- src/index.ts:293-326 (schema)Tool definition including name, description, and inputSchema for 'update_project_by_projectID' in the ListTools response, effectively registering the tool.{ name: "update_project_by_projectID", description: "Update an existing project's properties. Requires project ID. Can modify name, color, view mode, kind and sort order. Returns updated project details.", inputSchema: { type: "object", properties: { projectId:{ type: "string", description: "The ID of the project to update (required)" }, name: { type: "string", description: "New name for the project" }, color: { type: "string", description: "New hex color code for the project", }, sortOrder:{ type:"integer", description:"Updated sort order value" }, viewMode:{ type:"string", description:'Updated view mode: "list", "kanban", or "timeline"' }, kind:{ type:"string", description:'Updated project kind: "TASK" or "NOTE"' } }, required: ["projectId"], }, },
- src/index.ts:66-79 (schema)TypeScript interface definition for Project object used in the update_project_by_projectID handler.interface Project { id?: string; name?: string; color?: string; sortOrder?: number; viewMode? : string; kind? :string; closed?:boolean; groupId?: string; permission?:string; }
- src/index.ts:638-642 (helper)Helper function to validate projectId and taskId parameters, used in the tool handler.function throwValidError(projectId : string,taskId : string){ if(!projectId&&!taskId) throw new McpError(ErrorCode.InvalidRequest,"projectId 和 taskId 为空") if(!projectId) throw new McpError(ErrorCode.InvalidRequest,"projectId 为空") if(!taskId) throw new McpError(ErrorCode.InvalidRequest,"taskId 为空") }