Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

get_repository

Retrieve repository details including branches, pull requests, and metadata from Bitbucket Cloud to manage and analyze code projects.

Instructions

Get details of a specific repository including its branches, pull requests, and other metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug

Implementation Reference

  • The main handler logic for the 'get_repository' MCP tool. It validates input parameters using the Zod schema and delegates to the RepositoriesAPI.get method to fetch the repository details from Bitbucket.
    case 'get_repository': {
      const params = toolSchemas.get_repository.parse(args);
      return this.repos.get(params);
    }
  • Zod schema for validating input parameters of the get_repository tool (workspace and repo_slug). Used in the handler for parsing args.
    get_repository: z.object({
      workspace: z.string().describe('The workspace slug'),
      repo_slug: z.string().describe('The repository slug'),
    }),
  • Registration of the 'get_repository' tool in the MCP toolDefinitions array, including name, description, and JSON schema for inputs.
      name: 'get_repository',
      description:
        'Get details of a specific repository including its branches, pull requests, and other metadata.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          workspace: { type: 'string', description: 'The workspace slug' },
          repo_slug: { type: 'string', description: 'The repository slug' },
        },
        required: ['workspace', 'repo_slug'],
      },
    },
  • Supporting method in RepositoriesAPI that executes the Bitbucket API GET request to retrieve details of the specified repository.
    async get(params: GetRepositoryParams): Promise<BitbucketRepository> {
      const { workspace, repo_slug } = params;
      return this.client.get<BitbucketRepository>(`/repositories/${workspace}/${repo_slug}`);
    }
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 states it's a read operation ('Get details'), which implies non-destructive behavior, but doesn't disclose authentication requirements, rate limits, error conditions, or what 'details' specifically include beyond the mentioned branches/pull requests. For a tool with no annotation coverage, this leaves significant behavioral gaps.

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 a single, efficient sentence that front-loads the core purpose. It avoids unnecessary words and directly states what the tool does. However, it could be slightly more structured by explicitly separating the action from the included details for even clearer scanning.

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 the tool's moderate complexity (fetching repository details with multiple sub-resources), no annotations, and no output schema, the description is minimally adequate. It specifies the scope of returned data (branches, pull requests, metadata), but lacks details on authentication, error handling, pagination, or exact response structure. This leaves the agent with incomplete context for reliable use.

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%, with both parameters ('workspace', 'repo_slug') clearly documented in the schema. The description adds no parameter-specific information beyond implying these are needed to identify 'a specific repository'. This meets the baseline of 3 when schema coverage is high, but doesn't provide additional value like format examples or constraints.

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 ('Get') and resource ('repository') with specific details about what information is retrieved ('details... including its branches, pull requests, and other metadata'). It distinguishes from sibling tools like 'list_repositories' (which lists multiple) and 'get_branch'/'get_pull_request' (which focus on specific sub-resources). However, it doesn't explicitly contrast with all similar siblings like 'get_commit' or 'get_issue'.

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

Usage Guidelines2/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. It doesn't mention prerequisites (like authentication needs), when not to use it, or how it differs from related tools like 'list_repositories' (for listing all) or 'get_branch'/'get_pull_request' (for specific sub-resources). The agent must infer usage from the tool name and description alone.

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

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