create_task
Add tasks to TickTick with title, description, due dates, priorities, and tags to organize your workflow.
Instructions
Create a new task in TickTick
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Task title (required) | |
| content | No | Task description/content | |
| projectId | No | Project ID where the task should be created | |
| dueDate | No | Due date in ISO format | |
| priority | No | Task priority (0=None, 1=Low, 3=Medium, 5=High) | |
| tags | No | Task tags |
Implementation Reference
- src/index.ts:270-282 (handler)MCP tool handler for 'create_task': validates required title, calls TickTickClient.createTask with args, and returns success message with created task JSON.case 'create_task': if (!args?.title) { throw new McpError(ErrorCode.InvalidParams, 'Title is required'); } const newTask = await this.ticktickClient!.createTask(args); return { content: [ { type: 'text', text: `Task created successfully: ${JSON.stringify(newTask, null, 2)}`, }, ], };
- src/index.ts:90-124 (registration)Registration of 'create_task' tool in ListTools response, including name, description, and detailed input schema with properties and required fields.{ name: 'create_task', description: 'Create a new task in TickTick', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Task title (required)', }, content: { type: 'string', description: 'Task description/content', }, projectId: { type: 'string', description: 'Project ID where the task should be created', }, dueDate: { type: 'string', description: 'Due date in ISO format', }, priority: { type: 'number', description: 'Task priority (0=None, 1=Low, 3=Medium, 5=High)', }, tags: { type: 'array', items: { type: 'string' }, description: 'Task tags', }, }, required: ['title'], }, },
- src/index.ts:93-124 (schema)Input schema definition for 'create_task' tool specifying properties, types, descriptions, and required title field.inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Task title (required)', }, content: { type: 'string', description: 'Task description/content', }, projectId: { type: 'string', description: 'Project ID where the task should be created', }, dueDate: { type: 'string', description: 'Due date in ISO format', }, priority: { type: 'number', description: 'Task priority (0=None, 1=Low, 3=Medium, 5=High)', }, tags: { type: 'array', items: { type: 'string' }, description: 'Task tags', }, }, required: ['title'], }, },
- src/ticktick-client.ts:299-308 (helper)Core helper method in TickTickClient that authenticates and performs POST request to TickTick API /task endpoint to create a new task.async createTask(task: Partial<TickTickTask>): Promise<TickTickTask> { await this.ensureAuthenticated(); try { const response = await this.client.post('/task', task); return response.data; } catch (error) { throw new Error(`Failed to create task: ${error instanceof Error ? error.message : 'Unknown error'}`); } }