delete_project
Remove projects from your Things 3 task management system by marking them as canceled using the project ID.
Instructions
删除项目(通过将其标记为已取消)。需要提供项目ID和授权令牌。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | 项目的ID(必需) | |
| authToken | No | 授权令牌(如未提供,将使用环境变量THINGS_AUTH_TOKEN) |
Implementation Reference
- src/index.js:639-663 (handler)The handler function that implements the delete_project tool logic. It constructs a Things URL scheme to update the project by setting it as canceled (effectively deleting it) and opens the URL.async handleDeleteProject(args) { const authToken = args.authToken || DEFAULT_AUTH_TOKEN; if (!authToken) { throw new Error('需要授权令牌。请设置环境变量THINGS_AUTH_TOKEN或在参数中提供authToken'); } // 通过将 canceled 设为 true 来实现删除效果 const params = { id: args.id, authToken, canceled: true, }; const url = buildThingsUrl('update-project', params); await this.openThingsUrl(url); return { content: [ { type: 'text', text: `🗑️ 项目已删除 (ID: ${args.id})`, }, ], }; }
- src/index.js:400-417 (registration)Registration of the 'delete_project' tool in the ListToolsRequestSchema handler, including the tool name, description, and input schema definition.{ name: 'delete_project', description: '删除项目(通过将其标记为已取消)。需要提供项目ID和授权令牌。', inputSchema: { type: 'object', properties: { id: { type: 'string', description: '项目的ID(必需)', }, authToken: { type: 'string', description: '授权令牌(如未提供,将使用环境变量THINGS_AUTH_TOKEN)', }, }, required: ['id'], }, },
- src/index.js:403-416 (schema)Input schema definition for the delete_project tool, specifying required 'id' parameter and optional 'authToken'.inputSchema: { type: 'object', properties: { id: { type: 'string', description: '项目的ID(必需)', }, authToken: { type: 'string', description: '授权令牌(如未提供,将使用环境变量THINGS_AUTH_TOKEN)', }, }, required: ['id'], },
- src/index.js:437-438 (handler)Dispatch case in the CallToolRequestSchema handler that routes 'delete_project' calls to the handleDeleteProject method.case 'delete_project': return await this.handleDeleteProject(args);