get_task_comments
Retrieve all comments for a specific ClickUp task, including author, text, and timestamps.
Instructions
Get comments for a ClickUp task. Returns comment details including text, author, and timestamps.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The ID of the task to get comments for | |
| start | No | Pagination start (timestamp) | |
| start_id | No | Pagination start ID |
Implementation Reference
- src/tools/comment-tools.ts:17-41 (registration)Registration of the 'get_task_comments' tool on the MCP server with Zod schema for task_id, start, and start_id parameters. The tool handler calls commentsClient.getTaskComments().
export function setupCommentTools(server: McpServer): void { // Register get_task_comments tool server.tool( 'get_task_comments', 'Get comments for a ClickUp task. Returns comment details including text, author, and timestamps.', { task_id: z.string().describe('The ID of the task to get comments for'), start: z.number().optional().describe('Pagination start (timestamp)'), start_id: z.string().optional().describe('Pagination start ID') }, async ({ task_id, ...params }) => { try { const result = await commentsClient.getTaskComments(task_id, params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error: any) { console.error('Error getting task comments:', error); return { content: [{ type: 'text', text: `Error getting task comments: ${error.message}` }], isError: true }; } } ); - src/tools/comment-tools.ts:27-40 (handler)Handler function for the 'get_task_comments' tool. Takes task_id and optional pagination params (start, start_id), calls the comments client, and returns the result as JSON text.
async ({ task_id, ...params }) => { try { const result = await commentsClient.getTaskComments(task_id, params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error: any) { console.error('Error getting task comments:', error); return { content: [{ type: 'text', text: `Error getting task comments: ${error.message}` }], isError: true }; } } - src/tools/comment-tools.ts:22-26 (schema)Zod schema defining input parameters for get_task_comments: task_id (required string), start (optional number), start_id (optional string).
{ task_id: z.string().describe('The ID of the task to get comments for'), start: z.number().optional().describe('Pagination start (timestamp)'), start_id: z.string().optional().describe('Pagination start ID') }, - The getTaskComments method on CommentsClient. Makes a GET request to /task/{taskId}/comment with optional query parameters. Returns a promise of comments array.
async getTaskComments(taskId: string, params?: GetTaskCommentsParams): Promise<{ comments: Comment[] }> { return this.client.get(`/task/${taskId}/comment`, params); } - src/clickup-client/comments.ts:46-49 (schema)GetTaskCommentsParams interface defining optional start (number) and start_id (string) properties for pagination.
export interface GetTaskCommentsParams { start?: number; start_id?: string; }