list_pull_requests
Retrieve pull requests from a Bitbucket repository with filtering options by state (OPEN, MERGED, DECLINED) to manage code review workflows.
Instructions
List pull requests in a repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace | Yes | The workspace slug | |
| repo_slug | Yes | The repository slug | |
| state | No | Filter by PR state (OPEN, MERGED, DECLINED) |
Implementation Reference
- src/BitbucketClient.ts:129-133 (handler)The implementation of `listPullRequests` in the `BitbucketClient` class, which makes the API call to Bitbucket.
async listPullRequests(workspace: string, repoSlug: string, state?: string): Promise<PullRequest[]> { const params = state ? { state } : {}; const response = await this.api.get(`/repositories/${workspace}/${repoSlug}/pullrequests`, { params }); return response.data.values; } - src/index.ts:468-483 (handler)The MCP tool handler for 'list_pull_requests' in `src/index.ts`.
case 'list_pull_requests': { const { workspace, repo_slug, state } = args as { workspace: string; repo_slug: string; state?: string; }; const pullRequests = await client.listPullRequests(workspace, repo_slug, state); return { content: [ { type: 'text', text: JSON.stringify(pullRequests, null, 2), }, ], }; }