Hi & welcome to the community.
To help us help you, please take quick look at the guide for correctly formatting your yaml in a post.
That will make a world of difference with people being able to interpret this for you.
Otherwise, is it safe to presume that you have setup the Spotify integration correctly & can you get this working manually by using Developer Tools > Actions? This is a great way to get started with something like this. Once you have something working you can ‘go to yaml mode’ & use that yaml in your automation or script.
Cheers
Nick