This is not necessary, as the output of the scripts executed as local plugins is automatically in the local section.
My local script in /usr/lib/check_mk_agent/local/ :
#!/bin/bash
echo "P \"My service\" humidity=37;40:60;30:70 My service output\nA line with details\nAnother line with details"
The result:
Tested on 2.2p17 and 2.2p23.