Skip to main content
Glama
RajuSudhar

Atlassian Bitbucket MCP Server

by RajuSudhar

bitbucket_list_repositories

List repositories in a Bitbucket project using the project key, with pagination support.

Instructions

List repositories in a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYesProject key
limitNoMax results
startNoPagination start

Implementation Reference

  • Handler function that executes the bitbucket_list_repositories tool logic. Parses args using projectListShape, checks 'read_repo' permission, uses cache, and calls repoApi.listRepositories().
    bitbucket_list_repositories: async (args: unknown): Promise<McpToolResult> => {
      const start = Date.now();
      try {
        const input = z.object(projectListShape).parse(args);
        requirePermission(config, 'read_repo');
        log('info', 'tool start', {
          operation: 'tool_execute',
          toolName: 'bitbucket_list_repositories',
        });
    
        const ck = cacheKey(
          config.bitbucketUrl,
          'repos',
          `${input.project}:${input.limit ?? 25}:${input.start ?? 0}`
        );
        const cached = cache.get(ck);
        if (cached !== null) {
          log('info', 'tool end (cached)', {
            toolName: 'bitbucket_list_repositories',
            durationMs: Date.now() - start,
          });
          return textResult(cached);
        }
    
        const result = await repoApi.listRepositories(input.project, input.limit, input.start);
        cache.set(ck, result, config.cache.ttlRepos);
        log('info', 'tool end', {
          toolName: 'bitbucket_list_repositories',
          durationMs: Date.now() - start,
        });
        return textResult(result);
      } catch (err) {
        log('error', 'tool error', {
          toolName: 'bitbucket_list_repositories',
          error: String(err),
          durationMs: Date.now() - start,
        });
        return errorResult('LIST_REPOS_FAILED', err instanceof Error ? err.message : String(err));
      }
    },
  • Input schema definition for bitbucket_list_repositories: project (required), limit (optional), start (optional).
    export const projectListShape = { project, limit, start } as const;
  • Tool registration entry pairing the tool name 'bitbucket_list_repositories' with its description, shape (projectListShape), and handler.
    {
      name: 'bitbucket_list_repositories',
      description: 'List repositories in a project',
      shape: projectListShape,
      handler: h.repo.bitbucket_list_repositories,
    },
  • Helper API method that makes the actual HTTP request to GET /projects/{project}/repos with pagination params.
    async listRepositories(
      project: string,
      limit = 25,
      start = 0
    ): Promise<BitbucketPagedResponse<BitbucketRepository>> {
      return this.client.requestJson<BitbucketPagedResponse<BitbucketRepository>>(
        `/projects/${project}/repos`,
        { queryParams: { limit, start } }
      );
    }
Behavior2/5

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

With no annotations present, the description should disclose all behavioral traits. It does not mention that the tool returns paginated results, any ordering, or rate limits. The presence of 'start' and 'limit' parameters hints at pagination, but the description does not confirm this behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely short (one sentence), which is concise but lacks important details. It is not verbose, but could be more informative without adding excessive length.

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?

No output schema exists, so the description should explain the return value (e.g., an array of repository objects). It does not mention pagination behavior, default limits, or any filtering beyond the required project key. For a list tool, this is insufficient context.

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 input schema has 100% description coverage, so the baseline is 3. The description adds no extra meaning beyond the schema, but it also does not contradict it. The schema already provides meaningful descriptions for each parameter.

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 'List' and the resource 'repositories in a project', making the tool's purpose immediately understandable. However, it does not distinguish itself from siblings like 'bitbucket_get_repository' (which is for a single repo) or search tools, missing an opportunity to clarify scope.

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 is provided on when to use this tool versus searching for repositories (e.g., via 'bitbucket_search_code') or viewing details of a single repository. The description lacks context about typical use cases or prerequisites.

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