get_issue_comments
Retrieve comments for a Backlog issue using issue ID or key, with options to filter by comment ID range, limit results, and sort order.
Instructions
Returns list of comments for an issue
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueId | No | The numeric ID of the issue (e.g., 12345) | |
| issueKey | No | The key of the issue (e.g., 'PROJ-123') | |
| minId | No | Minimum comment ID | |
| maxId | No | Maximum comment ID | |
| count | No | Number of comments to retrieve | |
| order | No | Sort order |
Implementation Reference
- src/tools/getIssueComments.ts:47-70 (handler)The main tool definition including the handler function that implements the logic for 'get_issue_comments' by resolving the issue identifier and calling the Backlog API to retrieve comments.export const getIssueCommentsTool = ( backlog: Backlog, { t }: TranslationHelper ): ToolDefinition< ReturnType<typeof getIssueCommentsSchema>, (typeof IssueCommentSchema)['shape'] > => { return { name: 'get_issue_comments', description: t( 'TOOL_GET_ISSUE_COMMENTS_DESCRIPTION', 'Returns list of comments for an issue' ), schema: z.object(getIssueCommentsSchema(t)), outputSchema: IssueCommentSchema, handler: async ({ issueId, issueKey, ...params }) => { const result = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t); if (!result.ok) { throw result.error; } return backlog.getIssueComments(result.value, params); }, }; };
- src/tools/getIssueComments.ts:8-45 (schema)Zod schema defining the input parameters for the get_issue_comments tool, including issueId or issueKey, optional filters like minId, maxId, count, and order.const getIssueCommentsSchema = buildToolSchema((t) => ({ issueId: z .number() .optional() .describe( t( 'TOOL_GET_ISSUE_COMMENTS_ISSUE_ID', 'The numeric ID of the issue (e.g., 12345)' ) ), issueKey: z .string() .optional() .describe( t( 'TOOL_GET_ISSUE_COMMENTS_ISSUE_KEY', "The key of the issue (e.g., 'PROJ-123')" ) ), minId: z .number() .optional() .describe(t('TOOL_GET_ISSUE_COMMENTS_MIN_ID', 'Minimum comment ID')), maxId: z .number() .optional() .describe(t('TOOL_GET_ISSUE_COMMENTS_MAX_ID', 'Maximum comment ID')), count: z .number() .optional() .describe( t('TOOL_GET_ISSUE_COMMENTS_COUNT', 'Number of comments to retrieve') ), order: z .enum(['asc', 'desc']) .optional() .describe(t('TOOL_GET_ISSUE_COMMENTS_ORDER', 'Sort order')), }));
- src/tools/tools.ts:93-116 (registration)The getIssueCommentsTool is registered in the 'issue' toolset group within the allTools export.getIssueTool(backlog, helper), getIssuesTool(backlog, helper), countIssuesTool(backlog, helper), addIssueTool(backlog, helper), updateIssueTool(backlog, helper), deleteIssueTool(backlog, helper), getIssueCommentsTool(backlog, helper), addIssueCommentTool(backlog, helper), getPrioritiesTool(backlog, helper), getCategoriesTool(backlog, helper), getCustomFieldsTool(backlog, helper), getIssueTypesTool(backlog, helper), getResolutionsTool(backlog, helper), getWatchingListItemsTool(backlog, helper), getWatchingListCountTool(backlog, helper), addWatchingTool(backlog, helper), updateWatchingTool(backlog, helper), deleteWatchingTool(backlog, helper), markWatchingAsReadTool(backlog, helper), getVersionMilestoneListTool(backlog, helper), addVersionMilestoneTool(backlog, helper), updateVersionMilestoneTool(backlog, helper), deleteVersionTool(backlog, helper), ],