get_threaded_comments
Retrieve all replies to a parent comment in a threaded format, with pagination to manage large comment sets.
Instructions
Get threaded comments (replies) for a parent comment. Returns comment details with pagination support.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comment_id | Yes | The ID of the parent comment | |
| start | No | Pagination start (timestamp) | |
| start_id | No | Pagination start ID |
Implementation Reference
- src/tools/comment-tools.ts:219-242 (registration)Registration of the 'get_threaded_comments' tool via server.tool(), defining its schema (comment_id required, start and start_id optional) and handler that calls commentsClient.getThreadedComments().
// Register get_threaded_comments tool server.tool( 'get_threaded_comments', 'Get threaded comments (replies) for a parent comment. Returns comment details with pagination support.', { comment_id: z.string().describe('The ID of the parent comment'), start: z.number().optional().describe('Pagination start (timestamp)'), start_id: z.string().optional().describe('Pagination start ID') }, async ({ comment_id, ...params }) => { try { const result = await commentsClient.getThreadedComments(comment_id, params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error: any) { console.error('Error getting threaded comments:', error); return { content: [{ type: 'text', text: `Error getting threaded comments: ${error.message}` }], isError: true }; } } ); - src/tools/comment-tools.ts:228-241 (handler)Handler function for the 'get_threaded_comments' tool that extracts comment_id and params, calls commentsClient.getThreadedComments(), and returns JSON-stringified result or error.
async ({ comment_id, ...params }) => { try { const result = await commentsClient.getThreadedComments(comment_id, params); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error: any) { console.error('Error getting threaded comments:', error); return { content: [{ type: 'text', text: `Error getting threaded comments: ${error.message}` }], isError: true }; } } - src/clickup-client/comments.ts:84-87 (schema)GetThreadedCommentsParams interface defining optional parameters (start and start_id) for pagination of threaded comments.
export interface GetThreadedCommentsParams { start?: number; start_id?: string; } - getThreadedComments method in CommentsClient class that sends a GET request to /comment/{commentId}/reply endpoint with optional pagination params.
async getThreadedComments(commentId: string, params?: GetThreadedCommentsParams): Promise<{ comments: Comment[] }> { return this.client.get(`/comment/${commentId}/reply`, params); }