approve_pr
Approve pull requests in Bitbucket repositories by specifying the repository slug and pull request ID to confirm approval.
Instructions
Approve a pull request.
Args:
repo_slug: Repository slug
pr_id: Pull request ID
Returns:
Approval confirmation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_slug | Yes | ||
| pr_id | Yes |
Implementation Reference
- src/server.py:981-999 (handler)MCP tool handler that approves a pull request by calling BitbucketClient.approve_pr and returns structured response with PR ID and approver.@mcp.tool() @handle_bitbucket_error @formatted def approve_pr(repo_slug: str, pr_id: int) -> dict: """Approve a pull request. Args: repo_slug: Repository slug pr_id: Pull request ID Returns: Approval confirmation """ client = get_client() result = client.approve_pr(repo_slug, pr_id) return { "pr_id": pr_id, "approved_by": result.get("user", {}).get("display_name"), }
- src/bitbucket_client.py:1006-1022 (helper)BitbucketClient method implementing the approve_pr functionality via Bitbucket API POST request to /pullrequests/{pr_id}/approve endpoint.def approve_pr( self, repo_slug: str, pr_id: int ) -> dict[str, Any]: """Approve a pull request. Args: repo_slug: Repository slug pr_id: Pull request ID Returns: Approval info """ result = self._request( "POST", self._repo_path(repo_slug, "pullrequests", str(pr_id), "approve"), ) return self._require_result(result, "approve PR", f"#{pr_id}")
- src/server.py:981-981 (registration)FastMCP @mcp.tool() decorator registering the approve_pr function as an MCP tool.@mcp.tool()