Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

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
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
pr_idYesThe pull request ID
pageNoPage number
pagelenNoResults per page

Implementation Reference

  • 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, }); }
  • 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'), }),
  • 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'], }, },
  • 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> ); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Lexmata/bitbucket-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server