Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

list_repositories

Retrieve and filter repositories from a Bitbucket Cloud workspace with paginated results, sorting, and role-based access.

Instructions

List repositories in a workspace. Returns paginated results with repository details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
roleNoFilter by role
qNoQuery string for filtering
sortNoSort field (e.g., "-updated_on")
pageNoPage number
pagelenNoResults per page (max 100)

Implementation Reference

  • Core handler function that executes the Bitbucket API request to list repositories in a workspace.
    async list(params: ListRepositoriesParams): Promise<PaginatedResponse<BitbucketRepository>> {
      const { workspace, ...queryParams } = params;
      return this.client.get<PaginatedResponse<BitbucketRepository>>(
        `/repositories/${workspace}`,
        queryParams as Record<string, string | number | undefined>
      );
    }
  • MCP tool handler dispatch that validates input schema and calls the RepositoriesAPI.list method.
    case 'list_repositories': {
      const params = toolSchemas.list_repositories.parse(args);
      return this.repos.list(params);
    }
  • Tool registration in the toolDefinitions array, including name, description, and input schema for MCP.
    {
      name: 'list_repositories',
      description:
        'List repositories in a workspace. Returns paginated results with repository details.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          workspace: { type: 'string', description: 'The workspace slug' },
          role: {
            type: 'string',
            enum: ['owner', 'admin', 'contributor', 'member'],
            description: 'Filter by role',
          },
          q: { type: 'string', description: 'Query string for filtering' },
          sort: { type: 'string', description: 'Sort field (e.g., "-updated_on")' },
          page: { type: 'number', description: 'Page number' },
          pagelen: { type: 'number', description: 'Results per page (max 100)' },
        },
        required: ['workspace'],
      },
    },
  • Zod schema definition for input parameters of list_repositories tool.
    list_repositories: z.object({
      workspace: z.string().describe('The workspace slug'),
      role: z.enum(['owner', 'admin', 'contributor', 'member']).optional().describe('Filter by role'),
      q: z.string().optional().describe('Query string for filtering'),
      sort: z.string().optional().describe('Sort field (e.g., "-updated_on")'),
      page: z.number().optional().describe('Page number'),
      pagelen: z.number().optional().describe('Results per page (max 100)'),
    }),
  • TypeScript interface defining the parameters for listing repositories.
    export interface ListRepositoriesParams {
      workspace: string;
      role?: 'owner' | 'admin' | 'contributor' | 'member';
      q?: string;
      sort?: string;
      page?: number;
      pagelen?: number;
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It usefully adds that results are paginated, which isn't obvious from the schema alone. However, it doesn't describe authentication requirements, rate limits, error conditions, or what 'repository details' specifically includes. For a read operation with 6 parameters, more behavioral context would be helpful.

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 perfectly concise at two sentences. The first sentence states the core purpose, and the second adds critical behavioral context about pagination. Every word earns its place with zero redundancy or unnecessary elaboration.

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?

For a read-only list operation with good schema coverage but no output schema, the description provides adequate but minimal context. It covers the basic purpose and pagination behavior, but lacks details about authentication, error handling, or what specific repository details are returned. Given the 6 parameters and no annotations, more completeness would be beneficial.

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%, so the schema already documents all 6 parameters thoroughly. The description adds no additional parameter semantics beyond mentioning pagination (implied by page/pagelen parameters) and filtering (implied by role/q parameters). This meets the baseline expectation when schema coverage is complete.

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 action ('List repositories') and resource ('in a workspace'), making the purpose immediately understandable. It distinguishes itself from other list operations like list_branches or list_issues by specifying repositories. However, it doesn't explicitly differentiate from list_repository_forks, which is a similar but distinct operation.

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 when to choose list_repositories over get_repository (for single repo details) or list_repository_forks (for fork-specific listings). No context about prerequisites, typical use cases, or exclusions is provided.

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