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); }

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