Skip to main content
Glama
RajuSudhar

Atlassian Bitbucket MCP Server

by RajuSudhar

bitbucket_reply_to_comment

Reply to a specific comment on a Bitbucket pull request with a text message.

Instructions

Reply to a comment on a pull request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesProject key
repoYesRepository slug
prIdYesPull request ID
commentIdYesParent comment ID
textYesReply text

Implementation Reference

  • Handler function for the bitbucket_reply_to_comment tool. Validates input using replyToCommentShape, requires 'write_pr' permission, calls prApi.replyToComment(), invalidates PR cache, and returns the result.
    bitbucket_reply_to_comment: async (args: unknown): Promise<McpToolResult> => {
      const start = Date.now();
      try {
        const input = z.object(replyToCommentShape).parse(args);
        requirePermission(config, 'write_pr');
        log('info', 'tool start', {
          operation: 'tool_execute',
          toolName: 'bitbucket_reply_to_comment',
        });
        const result = await prApi.replyToComment(
          input.project,
          input.repo,
          input.prId,
          input.commentId,
          input.text
        );
        invalidatePrCache(cache, config, input.project, input.repo, input.prId);
        log('info', 'tool end', {
          toolName: 'bitbucket_reply_to_comment',
          durationMs: Date.now() - start,
        });
        return textResult(result);
      } catch (err) {
        log('error', 'tool error', {
          toolName: 'bitbucket_reply_to_comment',
          error: String(err),
          durationMs: Date.now() - start,
        });
        return errorResult('REPLY_FAILED', err instanceof Error ? err.message : String(err));
      }
    },
  • Zod schema (ZodRawShape) defining the input shape for bitbucket_reply_to_comment. Extends prRefShape (project, repo, prId) and adds commentId and text fields.
    export const replyToCommentShape = {
      ...prRefShape,
      commentId: z.coerce.number().int().positive().describe('Parent comment ID'),
      text: z.string().min(1).describe('Reply text'),
    } as const;
  • Registration entry for the bitbucket_reply_to_comment tool in the tool registry, linking name, description, input shape, and handler.
    {
      name: 'bitbucket_reply_to_comment',
      description: 'Reply to a comment on a pull request',
      shape: replyToCommentShape,
      handler: h.pr.bitbucket_reply_to_comment,
    },
  • Bitbucket API method that sends a POST request to create a reply comment with a parent comment ID.
    async replyToComment(
      project: string,
      repo: string,
      prId: number,
      commentId: number,
      text: string
    ): Promise<BitbucketComment> {
      return this.client.requestJson<BitbucketComment>(
        `/projects/${project}/repos/${repo}/pull-requests/${prId}/comments`,
        { method: 'POST', body: { text, parent: { id: commentId } } }
      );
    }
  • Base schema reused by replyToCommentShape, providing project, repo, and prId fields.
    export const prRefShape = { project, repo, prId } as const;
Behavior2/5

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

No annotations provided, so the description is the sole source of behavioral context. It only states 'Reply to a comment' without disclosing mutation effects, permissions, or whether the reply is nested. This is insufficient for an agent to understand side effects.

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 sentence with no wasted words. However, it could be expanded without becoming verbose given the lack of other guidance.

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?

For a tool with 5 required parameters, no output schema, and no annotations, the description is too sparse. It fails to explain the expected outcome (e.g., the reply becomes a child comment) or any prerequisites like existing parent comment ID.

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?

The input schema has 100% description coverage for all parameters, so the baseline is 3. The tool description adds no new information about parameters beyond what the schema already provides.

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 uses the specific verb 'Reply' and resource 'comment on a pull request', clearly indicating the action. While siblings like bitbucket_add_pr_comment and bitbucket_update_comment exist, 'reply' suggests responding to an existing comment, which provides some differentiation.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives like add_pr_comment (for new top-level comments) or resolve_comment. The description lacks any when-to-use or when-not-to-use information.

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/RajuSudhar/atlassian-bitbucket-mcp'

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