Skip to main content
Glama
garc33

Bitbucket Server MCP

by garc33

get_comments

Retrieve pull request comments to read discussion and feedback without other activities like reviews or commits.

Instructions

Retrieve only the comments from a pull request. Use this when you specifically want to read the discussion and feedback comments without other activities like reviews or commits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNoBitbucket project key. If omitted, uses BITBUCKET_DEFAULT_PROJECT environment variable.
repositoryYesRepository slug containing the pull request.
prIdYesPull request ID to get comments for.

Implementation Reference

  • The main handler function that implements the get_comments tool logic: fetches PR activities from Bitbucket API and filters for comments (action === 'COMMENTED').
    private async getComments(params: PullRequestParams) {
      const { project, repository, prId } = params;
      
      if (!project || !repository || !prId) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Project, repository, and prId are required'
        );
      }
      
      const response = await this.api.get(
        `/projects/${project}/repos/${repository}/pull-requests/${prId}/activities`
      );
    
      const comments = response.data.values.filter(
        (activity: BitbucketActivity) => activity.action === 'COMMENTED'
      );
    
      return {
        content: [{ type: 'text', text: JSON.stringify(comments, null, 2) }]
      };
    }
  • Input schema definition for the get_comments tool, specifying parameters: project (optional), repository, prId.
    {
      name: 'get_comments',
      description: 'Retrieve only the comments from a pull request. Use this when you specifically want to read the discussion and feedback comments without other activities like reviews or commits.',
      inputSchema: {
        type: 'object',
        properties: {
          project: { type: 'string', description: 'Bitbucket project key. If omitted, uses BITBUCKET_DEFAULT_PROJECT environment variable.' },
          repository: { type: 'string', description: 'Repository slug containing the pull request.' },
          prId: { type: 'number', description: 'Pull request ID to get comments for.' }
        },
        required: ['repository', 'prId']
      }
    },
  • src/index.ts:538-545 (registration)
    Registration in the central tool request handler switch statement that dispatches get_comments calls to the getComments method.
    case 'get_comments': {
      const commentsPrParams: PullRequestParams = {
        project: getProject(args.project as string),
        repository: args.repository as string,
        prId: args.prId as number
      };
      return await this.getComments(commentsPrParams);
    }
  • src/index.ts:394-394 (registration)
    The tool list (including get_comments) is registered to the MCP server via setTools, filtered for read-only mode.
    ].filter(tool => !this.config.readOnly || readOnlyTools.includes(tool.name))
  • src/index.ts:162-162 (registration)
    get_comments is included in readOnlyTools array, allowing it in read-only mode.
    const readOnlyTools = ['list_projects', 'list_repositories', 'get_pull_request', 'get_diff', 'get_reviews', 'get_activities', 'get_comments', 'search', 'get_file_content', 'browse_repository'];
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It correctly indicates this is a read operation ('retrieve'), but doesn't mention authentication requirements, rate limits, pagination behavior, or error conditions. The description is accurate but lacks comprehensive behavioral context needed for a read-only tool with no annotation coverage.

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

Conciseness5/5

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

The description is perfectly concise with two sentences that each earn their place. The first sentence states the core purpose, and the second provides essential usage guidance. There's zero waste or redundancy, and it's front-loaded with the most important information.

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

Completeness3/5

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

For a read-only tool with 3 parameters, 100% schema coverage, but no output schema or annotations, the description provides adequate purpose and usage guidance but lacks information about return values, error handling, or authentication. The agent knows what the tool does and when to use it, but not what to expect from the operation or potential constraints.

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 all parameters are documented in the schema. The description doesn't add any parameter-specific information beyond what the schema provides about project, repository, and prId. It correctly implies these parameters are needed but doesn't elaborate on their semantics, format, or relationships.

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

Purpose5/5

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

The description clearly states the specific verb ('retrieve') and resource ('comments from a pull request'), and distinguishes it from siblings by specifying 'only the comments' and contrasting with 'other activities like reviews or commits'. This provides precise differentiation from tools like get_activities or get_reviews.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool ('when you specifically want to read the discussion and feedback comments') and when not to use it ('without other activities like reviews or commits'), providing clear alternatives. This gives the agent perfect guidance on tool selection among siblings.

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/garc33/bitbucket-server-mcp-server'

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