Skip to main content
Glama
garc33

Bitbucket Server MCP

by garc33

get_activities

Retrieve the complete activity history and timeline for a Bitbucket pull request, including comments, reviews, commits, and other timeline events.

Instructions

Retrieve all activities for a pull request including comments, reviews, commits, and other timeline events. Use this to get the complete activity history and timeline of the pull request.

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 activities for.

Implementation Reference

  • The main handler function `getActivities` that fetches the activities for a specified pull request from the Bitbucket API endpoint `/pull-requests/{prId}/activities` and returns the response as formatted JSON.
    private async getActivities(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`
      );
    
      return {
        content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }]
      };
    }
  • The input schema definition for the 'get_activities' tool, specifying the required parameters: repository and prId, with optional project.
    {
      name: 'get_activities',
      description: 'Retrieve all activities for a pull request including comments, reviews, commits, and other timeline events. Use this to get the complete activity history and timeline of the pull request.',
      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 activities for.' }
        },
        required: ['repository', 'prId']
      }
    },
  • src/index.ts:529-536 (registration)
    The switch case registration in the CallToolRequestSchema handler that processes the tool call by constructing parameters and invoking the getActivities handler.
    case 'get_activities': {
      const activitiesPrParams: PullRequestParams = {
        project: getProject(args.project as string),
        repository: args.repository as string,
        prId: args.prId as number
      };
      return await this.getActivities(activitiesPrParams);
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It describes what the tool retrieves but doesn't disclose behavioral traits like whether this is a read-only operation (implied by 'retrieve'), potential rate limits, authentication requirements, pagination behavior, or what happens if parameters are invalid. For a tool with no annotation coverage, this leaves significant gaps in understanding how it behaves.

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 two sentences that efficiently convey the purpose and usage without wasted words. It's front-loaded with the core functionality and follows with the intended use case. However, the second sentence could be slightly more concise by integrating with the first.

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?

Given no annotations and no output schema, the description provides basic purpose and usage but lacks details on behavioral aspects (e.g., safety, performance) and output format. For a tool with 3 parameters and sibling tools offering overlapping functionality, more context on differentiation and operational traits would improve completeness.

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 three parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema (e.g., it doesn't explain relationships between parameters or provide usage examples). Baseline 3 is appropriate when the 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 verb 'retrieve' and resource 'activities for a pull request' with specific examples of what's included (comments, reviews, commits, timeline events). It distinguishes from siblings like get_comments or get_reviews by mentioning it retrieves 'all activities' including those elements, but doesn't explicitly contrast with get_pull_request which might also provide some activity information.

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 provides implied usage guidance by stating 'Use this to get the complete activity history and timeline,' suggesting this is for comprehensive historical data rather than specific subsets. However, it doesn't explicitly state when to use this versus alternatives like get_comments (for just comments) or get_pull_request (which might include some activity data), nor does it mention any 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/garc33/bitbucket-server-mcp-server'

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