decline_pr
Close a pull request without merging it in Bitbucket. Use this tool to reject pull requests that should not be integrated into the codebase.
Instructions
Decline (close without merging) a pull request.
Args:
repo_slug: Repository slug
pr_id: Pull request ID
Returns:
Declined PR info
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_slug | Yes | ||
| pr_id | Yes |
Implementation Reference
- src/server.py:1041-1059 (handler)MCP tool handler for 'decline_pr': decorated with @mcp.tool(), calls BitbucketClient.decline_pr to decline the pull request and returns formatted response.@mcp.tool() @handle_bitbucket_error @formatted def decline_pr(repo_slug: str, pr_id: int) -> dict: """Decline (close without merging) a pull request. Args: repo_slug: Repository slug pr_id: Pull request ID Returns: Declined PR info """ client = get_client() result = client.decline_pr(repo_slug, pr_id) return { "pr_id": pr_id, "state": result.get("state"), }
- src/bitbucket_client.py:1060-1076 (helper)Helper method on BitbucketClient that performs the actual API POST request to decline the PR.def decline_pr( self, repo_slug: str, pr_id: int ) -> dict[str, Any]: """Decline (close) a pull request. Args: repo_slug: Repository slug pr_id: Pull request ID Returns: Declined PR info """ result = self._request( "POST", self._repo_path(repo_slug, "pullrequests", str(pr_id), "decline"), ) return self._require_result(result, "decline PR", f"#{pr_id}")