Skip to main content
Glama
jlromano

Bitbucket MCP Server

by jlromano

create_pull_request

Create a new pull request in Bitbucket to propose code changes from a source branch to a destination branch for review and merging.

Instructions

Create a new pull request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
titleYesThe pull request title
source_branchYesThe source branch name
destination_branchYesThe destination branch name
descriptionNoThe pull request description (optional)

Implementation Reference

  • The actual implementation of createPullRequest in BitbucketClient.ts.
    async createPullRequest(
      workspace: string,
      repoSlug: string,
      title: string,
      sourceBranch: string,
      destinationBranch: string,
      description?: string
    ): Promise<PullRequest> {
      const data = {
        title,
        description,
        source: {
          branch: { name: sourceBranch }
        },
        destination: {
          branch: { name: destinationBranch }
        }
      };
      
      const response = await this.api.post(`/repositories/${workspace}/${repoSlug}/pullrequests`, data);
      return response.data;
    }
  • src/index.ts:170-202 (registration)
    The MCP tool registration for 'create_pull_request'.
      name: 'create_pull_request',
      description: 'Create a new pull request',
      inputSchema: {
        type: 'object',
        properties: {
          workspace: {
            type: 'string',
            description: 'The workspace slug',
          },
          repo_slug: {
            type: 'string',
            description: 'The repository slug',
          },
          title: {
            type: 'string',
            description: 'The pull request title',
          },
          source_branch: {
            type: 'string',
            description: 'The source branch name',
          },
          destination_branch: {
            type: 'string',
            description: 'The destination branch name',
          },
          description: {
            type: 'string',
            description: 'The pull request description (optional)',
          },
        },
        required: ['workspace', 'repo_slug', 'title', 'source_branch', 'destination_branch'],
      },
    },
  • The tool handler switch case for 'create_pull_request' which calls the BitbucketClient method.
    case 'create_pull_request': {
      const { workspace, repo_slug, title, source_branch, destination_branch, description } = args as {
        workspace: string;
        repo_slug: string;
        title: string;
        source_branch: string;
        destination_branch: string;
        description?: string;
      };
      const pullRequest = await client.createPullRequest(
        workspace,
        repo_slug,
        title,
        source_branch,
        destination_branch,
        description
      );
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(pullRequest, null, 2),
          },
        ],
      };
    }
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. The description only states the action ('create') without any information about permissions required, side effects, error conditions, rate limits, or what happens upon success. For a mutation tool with zero annotation coverage, this is a critical gap in transparency.

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 extremely concise at just four words, with no wasted language. It is front-loaded with the core action, though this brevity comes at the cost of completeness. Every word earns its place by directly stating the tool's purpose, even if minimally.

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?

Given the complexity of creating a pull request (a mutation operation), the lack of annotations, and no output schema, the description is incomplete. It fails to address critical aspects like required permissions, what the tool returns, or how it interacts with the system, leaving significant gaps for an AI agent to operate effectively.

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 description adds no parameter semantics beyond what the input schema provides. However, with 100% schema description coverage, the baseline score is 3, as the schema already documents all parameters adequately. The description does not compensate or add value, but it also doesn't detract from the schema's completeness.

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

Purpose2/5

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

The description 'Create a new pull request' is a tautology that essentially restates the tool name without adding meaningful context. It specifies the verb 'create' and resource 'pull request' but lacks specificity about what a pull request entails in this system or how it differs from sibling tools like 'merge_pull_request' or 'list_pull_requests'.

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

Usage Guidelines1/5

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

The description provides no guidance on when to use this tool versus alternatives. There are no mentions of prerequisites, appropriate contexts, or exclusions, leaving the agent to infer usage from the tool name alone. This is particularly problematic given sibling tools like 'merge_pull_request' and 'list_pull_requests' that handle related operations.

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

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