MacBook Pro 13'' 2017 (A1708) after year of use showing 50% capacity
Shut down the laptop, then turn it on while holding the D key. It will open the Apple Diagnostics Test (https://support.apple.com/en-us/HT202731). After the test is done, the results may show if there's something wrong with your battery. If there are critical errors, I'm afraid that you may have to replace the battery. Is your laptop still on warranty? If it is, you can actually do it for free at an Apple Authorized Service Center, it doesn't have to be an Apple Service Center.