Skip to main content
Glama
RajuSudhar

Atlassian Bitbucket MCP Server

by RajuSudhar

bitbucket_get_repository

Fetches repository details from Bitbucket by providing the project key and repository slug.

Instructions

Get repository details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesProject key
repoYesRepository slug

Implementation Reference

  • Handler for bitbucket_get_repository – parses input with repoRefShape, checks cache, calls repoApi.getRepository, and returns the repository details.
    bitbucket_get_repository: async (args: unknown): Promise<McpToolResult> => {
      const start = Date.now();
      try {
        const input = z.object(repoRefShape).parse(args);
        requirePermission(config, 'read_repo');
        log('info', 'tool start', {
          operation: 'tool_execute',
          toolName: 'bitbucket_get_repository',
        });
    
        const ck = cacheKey(config.bitbucketUrl, 'repo', `${input.project}/${input.repo}`);
        const cached = cache.get(ck);
        if (cached !== null) {
          log('info', 'tool end (cached)', {
            toolName: 'bitbucket_get_repository',
            durationMs: Date.now() - start,
          });
          return textResult(cached);
        }
    
        const result = await repoApi.getRepository(input.project, input.repo);
        cache.set(ck, result, config.cache.ttlRepoMeta);
        log('info', 'tool end', {
          toolName: 'bitbucket_get_repository',
          durationMs: Date.now() - start,
        });
        return textResult(result);
      } catch (err) {
        log('error', 'tool error', {
          toolName: 'bitbucket_get_repository',
          error: String(err),
          durationMs: Date.now() - start,
        });
        return errorResult('GET_REPO_FAILED', err instanceof Error ? err.message : String(err));
      }
    },
  • Input schema definition (repoRefShape) with project key and repo slug fields.
    export const repoRefShape = { project, repo } as const;
  • Registration entry linking the tool name 'bitbucket_get_repository' to its description, shape, and handler.
    {
      name: 'bitbucket_get_repository',
      description: 'Get repository details',
      shape: repoRefShape,
      handler: h.repo.bitbucket_get_repository,
    },
  • RepositoryApi.getRepository – makes the actual Bitbucket REST API call to GET /projects/{project}/repos/{repo}.
    async getRepository(project: string, repo: string): Promise<BitbucketRepository> {
      return this.client.requestJson<BitbucketRepository>(`/projects/${project}/repos/${repo}`);
    }
  • Individual zod schemas for 'project' and 'repo' fields used by repoRefShape.
    const project = z.string().min(1).describe('Project key');
    const repo = z.string().min(1).describe('Repository slug');
Behavior2/5

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

Without annotations, the description should disclose behavioral traits like authentication or output nature. It only repeats the tool's purpose, adding no value beyond the name.

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?

A single sentence is concise and front-loaded. However, it is minimal and could be slightly more informative without sacrificing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (2 parameters, no output schema), the description is adequate for basic understanding. It covers the core function, though return details are unspecified.

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 coverage is 100%, so the schema already documents both parameters' meanings. The description adds no additional parameter information, meeting the baseline.

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 tool retrieves repository details, but it does not differentiate from siblings like get_branches or get_commits. The verb+resource is specific and not a tautology.

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?

No guidance on when to use this tool versus alternatives. The description implies usage for retrieving repository details but lacks context or exclusions.

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

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