Shared library: custom step help

Finally I found that the problem here was label 'my-agent' that is not valid in a scripted pipeline. I changed my script with:

node('my-agent') {
  unLabel params.FOO, params.BAR
}

And it works.