create_checklist
Add a new checklist to any ClickUp task by specifying the task ID and checklist name. Returns the created checklist details.
Instructions
Create a new checklist in a ClickUp task. Returns the created checklist details.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The ID of the task to create the checklist in | |
| name | Yes | The name of the checklist |
Implementation Reference
- src/tools/checklist-tools.ts:12-34 (registration)Registration of the 'create_checklist' tool on the MCP server via server.tool(), with Zod schema for task_id and name inputs, and the async handler that calls checklistsClient.createChecklist().
server.tool( 'create_checklist', 'Create a new checklist in a ClickUp task. Returns the created checklist details.', { task_id: z.string().describe('The ID of the task to create the checklist in'), name: z.string().describe('The name of the checklist') }, async ({ task_id, name }) => { try { const checklist = await checklistsClient.createChecklist(task_id, { name } as CreateChecklistParams); return { content: [{ type: 'text', text: JSON.stringify(checklist, null, 2) }] }; } catch (error: any) { console.error('Error creating checklist:', error); return { content: [{ type: 'text', text: `Error creating checklist: ${error.message}` }], isError: true }; } } ); - src/tools/checklist-tools.ts:19-33 (handler)The async handler function for 'create_checklist' - extracts task_id and name, calls checklistsClient.createChecklist(), returns the result as JSON text, and handles errors.
async ({ task_id, name }) => { try { const checklist = await checklistsClient.createChecklist(task_id, { name } as CreateChecklistParams); return { content: [{ type: 'text', text: JSON.stringify(checklist, null, 2) }] }; } catch (error: any) { console.error('Error creating checklist:', error); return { content: [{ type: 'text', text: `Error creating checklist: ${error.message}` }], isError: true }; } } - CreateChecklistParams interface defining the input shape (name: string) for creating a checklist.
export interface CreateChecklistParams { name: string; // Note: The ClickUp API doesn't support creating items when creating a checklist // Items must be created separately using the createChecklistItem method } - The createChecklist method in ChecklistsClient class that sends a POST request to /task/{taskId}/checklist with the params.
async createChecklist(taskId: string, params: CreateChecklistParams): Promise<Checklist> { return this.client.post(`/task/${taskId}/checklist`, params); } - src/index.ts:7-7 (registration)Import of setupChecklistTools from the checklist-tools module.
import { setupChecklistTools } from './tools/checklist-tools.js';