I am having a problem with my laptop.
It started periodicallly shutting down automatically
with about 30% battery.
I noted the battery low warning and it shuts down.
Once plugged in it is at 30% and charges fine
Maybe it needs a new battery. I have a Macbook similar as yours with a swollen battery and a delaminated screen I took it to the Apple Store and they replaced the screen and the battery for free. They have a program for that.
With coconutBattery you are always aware of your current battery health. It shows you live information about the battery in your Mac and iOS devices (iPhone, iPad)
My 2012 did that after 4 years. It would shut off around 15-35%. I had the battery replaced and its been fine, though it will likely start happening to me again in the next year or two. The iPhones do something similar too when their batteries get that old unless you turn on that performance throttle battery saving feature. Anyway, I'd replace the battery if I were you.