update_repository
Modify Bitbucket repository settings including project assignment, visibility, description, and name to manage repository configuration.
Instructions
Update repository settings (project, visibility, description, name).
Use this to move a repository to a different project, change visibility,
update description, or rename the repository.
Args:
repo_slug: Repository slug (e.g., "anzsic_classifier")
project_key: Move to different project (optional, e.g., "DS")
is_private: Change visibility (optional)
description: Update description (optional)
name: Rename repository (optional)
Returns:
Updated repository info
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_slug | Yes | ||
| project_key | No | ||
| is_private | No | ||
| description | No | ||
| name | No |
Implementation Reference
- src/server.py:650-689 (handler)MCP tool handler for 'update_repository'. Decorated with @mcp.tool(), handles input parameters, calls BitbucketClient.update_repository, and formats the response.@mcp.tool() @handle_bitbucket_error @formatted def update_repository( repo_slug: str, project_key: Optional[str] = None, is_private: Optional[bool] = None, description: Optional[str] = None, name: Optional[str] = None, ) -> dict: """Update repository settings (project, visibility, description, name). Use this to move a repository to a different project, change visibility, update description, or rename the repository. Args: repo_slug: Repository slug (e.g., "anzsic_classifier") project_key: Move to different project (optional, e.g., "DS") is_private: Change visibility (optional) description: Update description (optional) name: Rename repository (optional) Returns: Updated repository info """ client = get_client() result = client.update_repository( repo_slug=repo_slug, project_key=project_key, is_private=is_private, description=description, name=name, ) return { "name": result.get("name"), "full_name": result.get("full_name"), "project": result.get("project", {}).get("key"), "private": result.get("is_private"), "description": result.get("description", ""), }
- src/bitbucket_client.py:787-821 (helper)BitbucketClient helper method that constructs the update payload and performs the PUT request to the Bitbucket API to update repository settings.def update_repository( self, repo_slug: str, project_key: Optional[str] = None, is_private: Optional[bool] = None, description: Optional[str] = None, name: Optional[str] = None, ) -> dict[str, Any]: """Update repository settings. Args: repo_slug: Repository slug project_key: Move to different project (optional) is_private: Change visibility (optional) description: Update description (optional) name: Rename repository (optional) Returns: Updated repository info """ payload = {} if project_key is not None: payload["project"] = {"key": project_key} if is_private is not None: payload["is_private"] = is_private if description is not None: payload["description"] = description if name is not None: payload["name"] = name if not payload: raise BitbucketError("No fields to update") result = self._request("PUT", self._repo_path(repo_slug), json=payload) return self._require_result(result, "update repository", repo_slug)
- src/server.py:650-650 (registration)Registration of the 'update_repository' tool using FastMCP's @mcp.tool() decorator.@mcp.tool()