Involved in bile acid metabolism. In liver hepatocytes catalyzes the second step in the conjugation of C24 bile acids (choloneates) to glycine and taurine before excretion into bile canaliculi. The major components of bile are cholic acid and chenodeoxycholic acid. In a first step the bile acids are converted to an acyl-CoA thioester, either in peroxisomes (primary bile acids deriving from the cholesterol pathway), or cytoplasmic at the endoplasmic reticulum (secondary bile acids). May catalyze the conjugation of primary or secondary bile acids, or both. The conjugation increases the detergent properties of bile acids in the intestine, which facilitates lipid and fat-soluble vitamin absorption. In turn, bile acids are deconjugated by bacteria in the intestine and are recycled back to the liver for reconjugation (secondary bile acids). May also act as an acyl-CoA thioesterase that regulates intracellular levels of free fatty acids. In vitro, catalyzes the hydrolysis of long- and very long-chain saturated acyl-CoAs to the free fatty acid and coenzyme A (CoASH), and conjugates glycine to these acyl-CoAs.