add_project
Create new projects in Things 3 with title, notes, deadlines, tags, areas, and subtasks to organize your tasks and manage workflows effectively.
Instructions
创建新的项目。支持标题、备注、区域、标签、子任务等。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | 项目标题 | |
| notes | No | 备注内容 | |
| when | No | 时间安排: today, tomorrow, evening, anytime, someday, 日期或日期时间 | |
| deadline | No | 截止日期(yyyy-mm-dd) | |
| tags | No | 标签,逗号分隔 | |
| areaId | No | 区域ID | |
| area | No | 区域标题 | |
| todos | No | 子待办事项列表 | |
| completed | No | 是否标记为完成 | |
| canceled | No | 是否标记为取消 | |
| reveal | No | 是否导航进入项目 |
Implementation Reference
- src/index.js:487-499 (handler)The handler function that implements the 'add_project' tool logic. It constructs a Things URL scheme using buildThingsUrl with 'add-project' command and the provided arguments, opens the URL to trigger project creation in Things app, and returns a success confirmation message.async handleAddProject(args) { const url = buildThingsUrl('add-project', args); await this.openThingsUrl(url); return { content: [ { type: 'text', text: `✅ 项目创建命令已发送${args.title ? `: ${args.title}` : ''}`, }, ], }; }
- src/index.js:120-169 (schema)The input schema defining the parameters and their types/descriptions for the 'add_project' tool, used for validation in the MCP protocol.inputSchema: { type: 'object', properties: { title: { type: 'string', description: '项目标题', }, notes: { type: 'string', description: '备注内容', }, when: { type: 'string', description: '时间安排: today, tomorrow, evening, anytime, someday, 日期或日期时间', }, deadline: { type: 'string', description: '截止日期(yyyy-mm-dd)', }, tags: { type: 'string', description: '标签,逗号分隔', }, areaId: { type: 'string', description: '区域ID', }, area: { type: 'string', description: '区域标题', }, todos: { type: 'array', items: { type: 'string' }, description: '子待办事项列表', }, completed: { type: 'boolean', description: '是否标记为完成', }, canceled: { type: 'boolean', description: '是否标记为取消', }, reveal: { type: 'boolean', description: '是否导航进入项目', }, }, },
- src/index.js:117-170 (registration)The tool registration entry in the ListToolsRequestSchema handler's tools array, specifying name, description, and inputSchema for 'add_project'.{ name: 'add_project', description: '创建新的项目。支持标题、备注、区域、标签、子任务等。', inputSchema: { type: 'object', properties: { title: { type: 'string', description: '项目标题', }, notes: { type: 'string', description: '备注内容', }, when: { type: 'string', description: '时间安排: today, tomorrow, evening, anytime, someday, 日期或日期时间', }, deadline: { type: 'string', description: '截止日期(yyyy-mm-dd)', }, tags: { type: 'string', description: '标签,逗号分隔', }, areaId: { type: 'string', description: '区域ID', }, area: { type: 'string', description: '区域标题', }, todos: { type: 'array', items: { type: 'string' }, description: '子待办事项列表', }, completed: { type: 'boolean', description: '是否标记为完成', }, canceled: { type: 'boolean', description: '是否标记为取消', }, reveal: { type: 'boolean', description: '是否导航进入项目', }, }, }, },
- src/index.js:429-430 (registration)Switch case in CallToolRequestSchema handler that registers and dispatches 'add_project' tool invocations to the corresponding handler method.case 'add_project': return await this.handleAddProject(args);
- src/utils.js:84-93 (helper)Helper utility function imported and used in the handler to construct the Things URL scheme for the 'add-project' command with properly encoded and mapped parameters.export function buildThingsUrl(command, params = {}) { const baseUrl = `things:///${command}`; const queryString = buildQueryString(params); if (!queryString) { return baseUrl; } return `${baseUrl}?${queryString}`; }