get_pull_request_comments
Retrieve and manage comments for a specific pull request in Backlog projects to track feedback and discussions.
Instructions
Returns list of comments for a pull request
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | No | The numeric ID of the project (e.g., 12345) | |
| projectKey | No | The key of the project (e.g., 'PROJECT') | |
| repoId | No | Repository ID | |
| repoName | No | Repository ID | |
| number | Yes | Pull request number | |
| minId | No | Minimum comment ID | |
| maxId | No | Maximum comment ID | |
| count | No | Number of comments to retrieve | |
| order | No | Sort order |
Implementation Reference
- The async handler function that resolves project and repository identifiers using utility functions and calls the Backlog client's getPullRequestComments method to retrieve the comments.handler: async ({ projectId, projectKey, repoId, repoName, number, ...params }) => { const result = resolveIdOrKey( 'project', { id: projectId, key: projectKey }, t ); if (!result.ok) { throw result.error; } const repoResult = resolveIdOrName( 'repository', { id: repoId, name: repoName }, t ); if (!repoResult.ok) { throw repoResult.error; } return backlog.getPullRequestComments( result.value, String(repoResult.value), number, params ); },
- Input schema definition using Zod for parameters like project ID/key, repo ID/name, pull request number, and optional filters for comments.const getPullRequestCommentsSchema = buildToolSchema((t) => ({ projectId: z .number() .optional() .describe( t( 'TOOL_GET_PROJECT_PROJECT_ID', 'The numeric ID of the project (e.g., 12345)' ) ), projectKey: z .string() .optional() .describe( t( 'TOOL_GET_PROJECT_PROJECT_KEY', "The key of the project (e.g., 'PROJECT')" ) ), repoId: z .number() .optional() .describe( t('TOOL_GET_PULL_REQUEST_COMMENTS_REPO_ID_OR_NAME', 'Repository ID') ), repoName: z .string() .optional() .describe( t('TOOL_GET_PULL_REQUEST_COMMENTS_REPO_ID_OR_NAME', 'Repository name') ), number: z .number() .describe( t('TOOL_GET_PULL_REQUEST_COMMENTS_NUMBER', 'Pull request number') ), minId: z .number() .optional() .describe(t('TOOL_GET_PULL_REQUEST_COMMENTS_MIN_ID', 'Minimum comment ID')), maxId: z .number() .optional() .describe(t('TOOL_GET_PULL_REQUEST_COMMENTS_MAX_ID', 'Maximum comment ID')), count: z .number() .optional() .describe( t( 'TOOL_GET_PULL_REQUEST_COMMENTS_COUNT', 'Number of comments to retrieve' ) ), order: z .enum(['asc', 'desc']) .optional() .describe(t('TOOL_GET_PULL_REQUEST_COMMENTS_ORDER', 'Sort order')), }));
- src/tools/tools.ts:142-142 (registration)The tool is instantiated and registered in the 'git' toolset group within the allTools function.getPullRequestCommentsTool(backlog, helper),