This paper presents an approach that integrates Unified Modeling Language (UML) use case and activity diagrams with formal specification methods using Z language to formalize a Library Management System (LMS). It emphasizes the need for consistency between UML diagrams and formal specifications to reduce ambiguity in system requirements and improve software reliability. The integration is validated using the Z/Eves tool, contributing to a more accurate and consistent specification process in software development.