create_task
Add new tasks to ClickUp lists by specifying list ID, task name, description, assignees, and due date to organize work.
Instructions
Create a new task in a ClickUp list
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list_id | Yes | ClickUp List ID | |
| name | Yes | Task name | |
| description | No | Task description | |
| assignees | No | Array of assignee user IDs | |
| due_date | No | Due date in Unix timestamp (milliseconds) |
Implementation Reference
- src/index.ts:170-201 (handler)The asynchronous handler function that implements the create_task tool. It constructs task data from arguments and posts it to the ClickUp API to create a new task, returning the response or an error.const createTask = async (args: any) => { try { const taskData: any = { name: args.name, }; if (args.description) taskData.description = args.description; if (args.assignees) taskData.assignees = args.assignees; if (args.due_date) taskData.due_date = parseInt(args.due_date); const response = await clickupApi.post(`/list/${args.list_id}/task`, taskData); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { if (axios.isAxiosError(error)) { return { content: [ { type: "text", text: `ClickUp API error: ${error.response?.data?.err ?? error.message}`, }, ], isError: true, }; } throw error; } };
- src/index.ts:48-77 (schema)The input schema and description for the create_task tool, defined within the server's capabilities.create_task: { description: "Create a new task in a ClickUp list", inputSchema: { type: "object", properties: { list_id: { type: "string", description: "ClickUp List ID" }, name: { type: "string", description: "Task name" }, description: { type: "string", description: "Task description" }, assignees: { type: "array", items: { type: "number" }, description: "Array of assignee user IDs" }, due_date: { type: "string", description: "Due date in Unix timestamp (milliseconds)" } }, required: ["list_id", "name"] } },
- src/index.ts:279-294 (registration)The CallToolRequestHandler registration where the create_task tool is dispatched by calling the createTask handler function based on the tool name.server.setRequestHandler(CallToolRequestSchema, async (request) => { // @ts-ignore const { name, arguments: args } = request.params; switch (name) { case 'get_tasks': return await getTasks(args); case 'create_task': return await createTask(args); case 'update_task': return await updateTask(args); case 'get_task': return await getTask(args); default: throw new Error(`Unknown tool: ${name}`); } });