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'],
      },
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the tool adds comments but doesn't disclose behavioral traits such as required permissions, whether comments are editable/deletable, rate limits, or response format. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. It could be slightly more structured by separating general vs. inline comment guidance, but it avoids waste and is appropriately sized for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a mutation tool with 6 parameters. It lacks details on behavioral context (e.g., auth needs, error handling) and doesn't explain return values. For its complexity, it should provide more guidance to be fully helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters. The description adds minimal value by hinting at the purpose of 'path' and 'line' for inline comments, but doesn't provide additional semantics beyond what the schema offers. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add a comment') and resource ('to a pull request'), distinguishing it from sibling tools like 'list_pr_comments' or 'update_pull_request'. However, it doesn't explicitly differentiate from all siblings (e.g., 'request_changes' might also involve commenting).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by mentioning 'general comment or an inline comment', suggesting when to use path/line parameters. However, it doesn't provide explicit guidance on when to choose this tool over alternatives like 'request_changes' or 'update_pull_request', nor does it mention prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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