Skip to main content
Glama
Lexmata

Bitbucket Cloud MCP Server

by Lexmata

list_pull_requests

Retrieve pull requests from a Bitbucket Cloud repository with filtering options to view open, merged, declined, or superseded requests.

Instructions

List pull requests for a repository with optional filtering by state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspaceYesThe workspace slug
repo_slugYesThe repository slug
stateNoFilter by state
pageNoPage number
pagelenNoResults per page

Implementation Reference

  • Tool handler case that parses the input parameters using Zod schema and delegates to PullRequestsAPI.list for execution.
    case 'list_pull_requests': { const params = toolSchemas.list_pull_requests.parse(args); return this.prs.list(params); }
  • Zod schema definition for validating input parameters of the list_pull_requests tool.
    list_pull_requests: z.object({ workspace: z.string().describe('The workspace slug'), repo_slug: z.string().describe('The repository slug'), state: z .enum(['OPEN', 'MERGED', 'DECLINED', 'SUPERSEDED']) .optional() .describe('Filter by state'), page: z.number().optional().describe('Page number'), pagelen: z.number().optional().describe('Results per page'), }),
  • MCP tool registration including name, description, and input schema for list_pull_requests.
    { name: 'list_pull_requests', description: 'List pull requests for a repository with optional filtering by state.', inputSchema: { type: 'object' as const, properties: { workspace: { type: 'string', description: 'The workspace slug' }, repo_slug: { type: 'string', description: 'The repository slug' }, state: { type: 'string', enum: ['OPEN', 'MERGED', 'DECLINED', 'SUPERSEDED'], description: 'Filter by state', }, page: { type: 'number', description: 'Page number' }, pagelen: { type: 'number', description: 'Results per page' }, }, required: ['workspace', 'repo_slug'], }, },
  • Core API helper method that performs the HTTP GET request to Bitbucket's pull requests endpoint.
    async list(params: ListPullRequestsParams): Promise<PaginatedResponse<BitbucketPullRequest>> { const { workspace, repo_slug, ...queryParams } = params; return this.client.get<PaginatedResponse<BitbucketPullRequest>>( `/repositories/${workspace}/${repo_slug}/pullrequests`, queryParams as Record<string, string | number | undefined> ); }
  • TypeScript interface defining the parameters for listing pull requests.
    export interface ListPullRequestsParams { workspace: string; repo_slug: string; state?: 'OPEN' | 'MERGED' | 'DECLINED' | 'SUPERSEDED'; 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