delete_project_by_projectID
Permanently delete a TickTick/Dida365 project and all its tasks using the project ID. This action removes the project and its contents from your task management system.
Instructions
Permanently delete a project by its ID. This will also delete all tasks within the project. Returns success message upon deletion.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | The ID of the project to delete (required) |
Implementation Reference
- src/index.ts:499-512 (handler)The core handler logic for the 'delete_project_by_projectID' tool. It extracts the projectId from arguments, validates it using throwValidError helper, performs a DELETE request to the Dida365 API endpoint `/project/${projectId}`, and returns a success message with the API response data.case "delete_project_by_projectID":{ const projectId:string = args.projectId as string; throwValidError(projectId,"1"); const response: AxiosResponse = await dida365Api.delete(`/project/${projectId}`); return { content: [ { type: "text", text: `删除项目成功: ${JSON.stringify(response.data, null, 2)}`, }, ], }; }
- src/index.ts:330-339 (schema)The input schema definition for the 'delete_project_by_projectID' tool, specifying that it requires a 'projectId' string parameter.inputSchema: { type: "object", properties: { projectId:{ type: "string", description: "The ID of the project to delete (required)" } }, required: ["projectId"], },
- src/index.ts:327-340 (registration)The tool registration entry in the ListTools response, defining the name, description, and input schema for 'delete_project_by_projectID'.{ name: "delete_project_by_projectID", description: "Permanently delete a project by its ID. This will also delete all tasks within the project. Returns success message upon deletion.", inputSchema: { type: "object", properties: { projectId:{ type: "string", description: "The ID of the project to delete (required)" } }, required: ["projectId"], }, }
- src/index.ts:638-642 (helper)Helper function used for input validation in the handler (and others). Checks if projectId and/or taskId are provided, throwing McpError if missing. Called with dummy taskId '1' in this tool's 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 为空") }