Skip to main content
Glama
jlromano

Bitbucket MCP Server

by jlromano

get_branch

Retrieve detailed information about a specific branch in a Bitbucket repository, including its commit history and metadata, to support repository management and development workflows.

Instructions

Get details of a specific branch

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
branch_nameYesThe branch name

Implementation Reference

  • The actual implementation of the getBranch method, which makes the API call to fetch branch details.
    async getBranch(workspace: string, repoSlug: string, branchName: string): Promise<Branch> {
      const response = await this.api.get(`/repositories/${workspace}/${repoSlug}/refs/branches/${branchName}`);
      return response.data;
    }
  • The handler logic in index.ts that processes the 'get_branch' tool call by calling the BitbucketClient.
    case 'get_branch': {
      const { workspace, repo_slug, branch_name } = args as {
        workspace: string;
        repo_slug: string;
        branch_name: string;
      };
      const branch = await client.getBranch(workspace, repo_slug, branch_name);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(branch, null, 2),
          },
        ],
      };
  • src/index.ts:102-119 (registration)
    The registration of the 'get_branch' tool, including its schema and description.
    {
      name: 'get_branch',
      description: 'Get details of a specific branch',
      inputSchema: {
        type: 'object',
        properties: {
          workspace: {
            type: 'string',
            description: 'The workspace slug',
          },
          repo_slug: {
            type: 'string',
            description: 'The repository slug',
          },
          branch_name: {
            type: 'string',
            description: 'The branch name',
          },

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