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; }

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