The area of matrix functions has received growing interest for a long period of time due to their growing applications.Having a numerical algorithm for a matrix function, the ideal situation is to have an estimate or bound for the error returned alongside the solution.Condition numbers serve this purpose; they measure the first order sensitivity of matrix functions to perturbations in the input data.We have observed that the existing crude condition number leads most of time to inferior bounds of relative forward errors for matrix functions of triangular and quasi-triangular matrices. We propose a condition number of matrix functions exploiting the structure of triangular and quasi-triangular matrices and derive an algorithm for exact computation of the condition number and another one for its estimation. The computational cost of the new condition number is no bigger than the existing unstructured one. Finally, our numerical experiment shows that the new condition number captures the behavior of the numerical algorithms and provides reasonable sharp bounds for the relative forward errors.