update_pipeline_variable
Modify pipeline variable values in Bitbucket repositories to configure CI/CD workflows and environment settings.
Instructions
Update a pipeline variable's value.
Args:
repo_slug: Repository slug
variable_uuid: Variable UUID (from list_pipeline_variables)
value: New variable value
Returns:
Updated variable info
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_slug | Yes | ||
| variable_uuid | Yes | ||
| value | Yes |
Implementation Reference
- src/server.py:560-585 (handler)MCP tool handler: calls BitbucketClient.update_pipeline_variable and formats response.@mcp.tool() @handle_bitbucket_error @formatted def update_pipeline_variable( repo_slug: str, variable_uuid: str, value: str, ) -> dict: """Update a pipeline variable's value. Args: repo_slug: Repository slug variable_uuid: Variable UUID (from list_pipeline_variables) value: New variable value Returns: Updated variable info """ client = get_client() result = client.update_pipeline_variable(repo_slug, variable_uuid, value) return { "uuid": result.get("uuid"), "key": result.get("key"), "secured": result.get("secured"), }
- src/bitbucket_client.py:709-731 (helper)BitbucketClient helper method: performs the HTTP PUT request to Bitbucket Pipelines API to update the variable value.def update_pipeline_variable( self, repo_slug: str, variable_uuid: str, value: str, ) -> dict[str, Any]: """Update a pipeline variable's value. Args: repo_slug: Repository slug variable_uuid: Variable UUID value: New variable value Returns: Updated variable info """ variable_uuid = ensure_uuid_braces(variable_uuid) result = self._request( "PUT", self._repo_path(repo_slug, "pipelines_config", "variables", variable_uuid), json={"value": value}, ) return self._require_result(result, "update pipeline variable")
- src/server.py:560-560 (registration)FastMCP tool registration decorator for the update_pipeline_variable tool.@mcp.tool()
- src/models.py:340-356 (schema)Pydantic model used for serializing pipeline variable responses in list/get/update operations.class PipelineVariableSummary(BaseModel): """Pipeline variable info.""" uuid: str = "" key: str = "" secured: bool = False value: Optional[str] = None # Only present for non-secured variables @classmethod def from_api(cls, data: dict) -> "PipelineVariableSummary": return cls( uuid=data.get("uuid", ""), key=data.get("key", ""), secured=data.get("secured", False), value=data.get("value"), # Will be None for secured variables )