As this script is more an classic active check then a checkmk check.
You cannot use the classic way with check parameters and then the checkmk check.
Take a look at the “check_tcp” checkmk/checks/check_tcp at 1.6.0 · Checkmk/checkmk · GitHub
“check_tcp” is only a checkmk plugin making the correct active check syntax for your monitoring core.
The monitoring core then is running your script.
And the options from WATO for this active check.
There the definition def _valuespec_active_checks_tcp():
and