Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

add_pr_comment

Add comments to Bitbucket Cloud pull requests for general feedback or specific file/line discussions. Use this tool to provide code reviews, ask questions, or share insights directly within pull requests.

Instructions

Add a comment to a pull request. Can be a general comment or an inline comment on a specific file/line.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
pr_idYesThe pull request ID
contentYesComment content (markdown)
pathNoFile path for inline comment
lineNoLine number for inline comment

Implementation Reference

  • Handler for the 'add_pr_comment' tool: parses input parameters using the Zod schema, constructs inline comment object if path and line provided, and delegates to PullRequestsAPI.addComment method.
    case 'add_pr_comment': { const params = toolSchemas.add_pr_comment.parse(args); const inline = params.path ? { path: params.path, line: params.line } : undefined; return this.prs.addComment( params.workspace, params.repo_slug, params.pr_id, params.content, inline ); }
  • Zod input schema definition for the 'add_pr_comment' tool, defining required and optional parameters with descriptions.
    add_pr_comment: 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'), content: z.string().describe('Comment content (markdown)'), path: z.string().optional().describe('File path for inline comment'), line: z.number().optional().describe('Line number for inline comment'), }),
  • Registration of the 'add_pr_comment' tool in the toolDefinitions array, including name, description, and JSON schema for MCP compatibility.
    { name: 'add_pr_comment', description: 'Add a comment to a pull request. Can be a general comment or an inline comment on a specific file/line.', 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' }, content: { type: 'string', description: 'Comment content (markdown)' }, path: { type: 'string', description: 'File path for inline comment' }, line: { type: 'number', description: 'Line number for inline comment' }, }, required: ['workspace', 'repo_slug', 'pr_id', 'content'], }, },

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