Skip to main content
Glama
garc33

Bitbucket Server MCP

by garc33

get_pull_request

Retrieve comprehensive pull request details including status, reviewers, commits, and metadata from Bitbucket Server to check progress, understand changes, and prepare for actions like merging or commenting.

Instructions

Retrieve comprehensive details about a specific pull request including status, reviewers, commits, and metadata. Use this to check PR status, review progress, understand changes, or gather information before performing actions like merging or commenting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNoBitbucket project key. If omitted, uses BITBUCKET_DEFAULT_PROJECT environment variable.
repositoryYesRepository slug containing the pull request.
prIdYesUnique pull request ID number (e.g., 123, 456).

Implementation Reference

  • The core handler function that executes the get_pull_request tool by calling the Bitbucket API to fetch PR details and returns formatted JSON response.
    private async getPullRequest(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}` ); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] }; }
  • Input schema definition for the get_pull_request tool, registered in ListToolsRequestSchema handler.
    { name: 'get_pull_request', description: 'Retrieve comprehensive details about a specific pull request including status, reviewers, commits, and metadata. Use this to check PR status, review progress, understand changes, or gather information before performing actions like merging or commenting.', 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: 'Unique pull request ID number (e.g., 123, 456).' } }, required: ['repository', 'prId'] } },
  • src/index.ts:450-457 (registration)
    Tool dispatch/registration in the switch statement of CallToolRequestSchema handler, which prepares parameters and calls the handler.
    case 'get_pull_request': { const getPrParams: PullRequestParams = { project: getProject(args.project as string), repository: args.repository as string, prId: args.prId as number }; return await this.getPullRequest(getPrParams); }
  • TypeScript interface defining parameters for pull request operations, used by getPullRequest handler.
    interface PullRequestParams extends RepositoryParams { prId?: number; }
  • src/index.ts:162-162 (registration)
    List of read-only tools that includes get_pull_request, used to filter tools 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'];

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