update_checklist
Update the name of an existing ClickUp checklist by providing its ID and new name.
Instructions
Update an existing ClickUp checklist's name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| checklist_id | Yes | The ID of the checklist to update | |
| name | Yes | The new name of the checklist |
Implementation Reference
- src/tools/checklist-tools.ts:36-59 (handler)The tool handler for 'update_checklist'. Uses server.tool() to register the tool with name 'update_checklist', accepts 'checklist_id' and 'name' as Zod-validated string parameters, and calls checklistsClient.updateChecklist() to update the checklist via the ClickUp API. Returns the updated checklist JSON or an error message.
// Register update_checklist tool server.tool( 'update_checklist', 'Update an existing ClickUp checklist\'s name.', { checklist_id: z.string().describe('The ID of the checklist to update'), name: z.string().describe('The new name of the checklist') }, async ({ checklist_id, name }) => { try { const checklist = await checklistsClient.updateChecklist(checklist_id, { name }); return { content: [{ type: 'text', text: JSON.stringify(checklist, null, 2) }] }; } catch (error: any) { console.error('Error updating checklist:', error); return { content: [{ type: 'text', text: `Error updating checklist: ${error.message}` }], isError: true }; } } ); - The UpdateChecklistParams interface defines the schema for updating a checklist: it requires a 'name' string.
export interface UpdateChecklistParams { name: string; } - The ChecklistsClient.updateChecklist() method sends a PUT request to /checklist/{checklistId} with the update parameters, delegating to the underlying ClickUpClient.
async updateChecklist(checklistId: string, params: UpdateChecklistParams): Promise<Checklist> { return this.client.put(`/checklist/${checklistId}`, params); } - src/index.ts:40-47 (registration)The root-level registration call: setupChecklistTools(this.server) is invoked inside ClickUpServer.setupTools(), which is called from the constructor.
private setupTools() { // Set up all tools setupTaskTools(this.server); setupDocTools(this.server); setupSpaceTools(this.server); setupChecklistTools(this.server); setupCommentTools(this.server); }