get_issue_comments
Retrieve comments for a specific issue in Backlog using issue ID or key, with options to filter by ID range, limit results, or sort order.
Instructions
Returns list of comments for an issue
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | Number of comments to retrieve | |
| issueIdOrKey | Yes | Issue ID or issue key | |
| maxId | No | Maximum comment ID | |
| minId | No | Minimum comment ID | |
| order | No | Sort order |
Implementation Reference
- src/tools/getIssueComments.ts:47-70 (handler)The getIssueCommentsTool factory function defines the tool 'get_issue_comments' including its handler logic. The handler resolves the issue ID or key and calls 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 for input parameters of the get_issue_comments tool, defining optional fields like issueId, issueKey, 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:94-94 (registration)Registration of the getIssueCommentsTool in the 'issue' toolset array within the allTools function.getIssueCommentsTool(backlog, helper),
- src/tools/tools.ts:18-18 (registration)Import of getIssueCommentsTool used for registration.import { getIssueCommentsTool } from './getIssueComments.js';