I think its complaining about the an index out of range. You need to be sure your "arglist" list really has three entries when you split it.
I've tidied up your main function (note, haven't run this):
def main(wf):
try:
if not len(wf.args):
raise Exception
arglist = wf.args[0].split(',')
randport1 = random.randint(5000,7000)
randport2 = random.randint(5000,7000)
port = arglist[0]
srv1 = arglist[1]
srv2 = arglist[2]
query = "-A -t -L 9800:localhost:{0} -L {1}:localhost:{2} user@{3} ssh -L {4}:localhost:9800 -L {5}:localhost:80 user@{6}".format(randport1,port,randport2,srv1,randport1,randport2,srv2)
wf.add_item(
title = "Jump from %s to %s" % (srv1,srv2),
arg = query,
valid = True,
icon = ICON_WEB)
except:
wf.add_item(title = "Error",
subtitle = "Malformed Input!",
icon = ICON_ERROR)
wf.send_feedback()