list_pr_comments
Retrieve all comments from a specific pull request in Bitbucket Cloud to review feedback and track discussions.
Instructions
List all comments on a pull request.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace | Yes | The workspace slug | |
| repo_slug | Yes | The repository slug | |
| pr_id | Yes | The pull request ID | |
| page | No | Page number | |
| pagelen | No | Results per page |
Implementation Reference
- src/tools/index.ts:961-967 (handler)Handler logic in ToolHandler.handleTool switch statement: validates input with Zod schema and delegates to PullRequestsAPI.listComments to fetch PR comments.case 'list_pr_comments': { const params = toolSchemas.list_pr_comments.parse(args); return this.prs.listComments(params.workspace, params.repo_slug, params.pr_id, { page: params.page, pagelen: params.pagelen, }); }
- src/tools/index.ts:123-129 (schema)Zod input schema for validating tool parameters.list_pr_comments: z.object({ workspace: z.string().describe('The workspace slug'), repo_slug: z.string().describe('The repository slug'), pr_id: z.number().describe('The pull request ID'), page: z.number().optional().describe('Page number'), pagelen: z.number().optional().describe('Results per page'), }),
- src/tools/index.ts:523-537 (registration)Tool registration in the toolDefinitions array used for MCP protocol, including name, description, and input schema.{ name: 'list_pr_comments', description: 'List all comments on a pull request.', inputSchema: { type: 'object' as const, properties: { workspace: { type: 'string', description: 'The workspace slug' }, repo_slug: { type: 'string', description: 'The repository slug' }, pr_id: { type: 'number', description: 'The pull request ID' }, page: { type: 'number', description: 'Page number' }, pagelen: { type: 'number', description: 'Results per page' }, }, required: ['workspace', 'repo_slug', 'pr_id'], }, },
- src/api/pullrequests.ts:157-167 (helper)Supporting method in PullRequestsAPI that performs the actual Bitbucket API GET request to list pull request comments.async listComments( workspace: string, repo_slug: string, pr_id: number, params?: { page?: number; pagelen?: number } ): Promise<PaginatedResponse<BitbucketPRComment>> { return this.client.get<PaginatedResponse<BitbucketPRComment>>( `/repositories/${workspace}/${repo_slug}/pullrequests/${pr_id}/comments`, params as Record<string, string | number | undefined> ); }